Knowledgebase
How to Fix: WCF .SVC File Gives A 404 Error
Posted by Phil (Netcetera) on 12 March 2013 09:46 AM

If visiting an SVC file on your site and it gives a 404 error, it is most likely because the handler mappings for svc have been removed from your site somehow.

 

To fix this, simply add the svc handlers to your web.config. The handlers described are below. Underneath them is an example of adding a managed handler(these would go into the <handlers> section of the web.config responsible for your application), if you need assisetance with writing the handler mappings many resources exist online as its a standard addition:

1)
Request path: *.svc
Executable: %SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
Name: svc-ISAPI-2.0-64

2)
Request path: *.svc
Executable: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
Name: svc-ISAPI-4.0_32bit

3)
Request path: *.svc
Executable: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
Name: svc-ISAPI-4.0_64bit

4) 
Request path: *.svc
Executable: %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Name: svc-ISAPI-2.0

5)
This one is a Managed Handler, not a script map:
Request path: *.svc
Type: System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Name: svc-Integrated-4.0


6) 6) 2.0 Integrated (3.0)
This one is a Managed Handler, not a script map:
Request path: *.svc
Type: System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Name: svc-Integrated-4.0

 

 

Example of a managed handler:

<add name=".svc"

            verb="*" 

           path="*.svc"

           type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  />


(2 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).