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:

  1. Open IIS Manager MMC snap-in.
  2. 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.
  3. Double-click Handler mappings in the Features View.
  4. 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:
    1. Click Add Managed Handler.
    2. Type *.svc into the Request path:.
    3. Type System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 into the Type textbox.
    4. Type svc-Integrated into the Name: textbox.
    5. Click OK.
    6. Click Add Script Map.
    7. Type *.svc into the Request path:.
    8. Type %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll into the Executable: text box.
    9. Type svc-ISAPI-2.0 into the Name: text box.
    10. 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.
    11. Click OK.

After that I browse my svc file again and it was working perfectly fine.

Comments

Popular posts from this blog

Unity brought back to Karachi

Dynamics 365 - Creating a view on runtime and assign it to the subgrid lookup field