WCF Deployment Issue
Recently I got a chance to deploy a WCF Service application on IIS 7.0. Deployment is more or less similar as a normal ASP.Net deployment, so I followed the same procedure. But when I tried to run service.svc file in the web browser it threw an error
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.
This is the thing you need to care about; handler is missing in this case. So you need to add the handlers for the svc content type. Here is the process for that:
Applicable for IIS 7.0:
- Open IIS Manager MMC snap-in.
- In the left pane, expand the node with the computer's name, then expand the Web Sites node, and then select the Default Web Site.
- Double-click Handler mappings in the Features View.
- In the list of application mappings, verify that the .svc file is mapped to the aspnet_isapi.dll. If the file has not been mapped:
- Click Add Managed Handler.
- Type *.svc into the Request path:.
- Type System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into the Type textbox.
- Type svc-Integrated into the Name: textbox.
- Click OK.
- Click Add Script Map.
- Type *.svc into the Request path:.
- Type %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll into the Executable: text box.
- Type svc-ISAPI-2.0 into the Name: text box.
- Using the Move Up/Move Down controls, ensure that the managed handler (svc-Integrated) appears before the aspnet_isapi (svc-ISAPI-2.0) handler in the list.
- Click OK.
After that I browse my svc file again and it was working perfectly fine.
Comments
Post a Comment