Problem:
After hosted a WCF service on localhost IIS, when visiting the .svc page, the following error occurrs:
__________________________________________________________________________________
Error Summary
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Detailed Error Information
Module
StaticFileModule
Notification
ExecuteRequestHandler
Handler
StaticFile
Error Code
0x80070032
Requested URL
http://localhost:80/CatService/CatService.svc
Physical Path
D:\CAT\CAT.WebApi\CatService.svc
Logon Method
Anonymous
Logon User
Anonymous
Most likely causes:
- It is possible that a handler mapping is missing. By default, the static file handler processes all content.
- The feature you are trying to use may not be installed.
- The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
- If ASP.NET is not installed.
Things you can try:
- In system.webServer/handlers:
- Ensure that the expected handler for the current page is mapped.
- Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.
- Pay extra attention to typographical errors in the expected handler line.
- Please verify that the feature you are trying to use is installed.
- Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.
- To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']
- The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
- For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
- Install ASP.NET.
- Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Screen shot:
Solution:
The methods listed in “things you can try:” are useless, but the following 2 command lines work.
aspnet_regiis -i & ServiceModelReg -i
1. Open command line as Administrator
2. Type the above commands and hit Enter key
3. After the commands finished successfully, revisit the page, the service meta data should show on page.