How to Fix: WCF .SVC File Gives A 404 Error


Saarthi's servers all have WCF service installed by default. If visiting an SVC file 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 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=31bf3856ad364e3
Name: svc-Integrated-4.0

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:
verb="*"
path="*.svc"
type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

I am receiving System.Security.SecurityException or That assembly does not allow partially trusted callers.

When running your application you may see: That assembly does not allow...

How can I redirect one URL to another on ASP .NET?

Our ASP plans have the following installed:...

Cryptography with ASP .NET

A customer received the following error when attempting to create a RSACryptoServiceProvider from...

I am getting a 404 error on the secondary pages of my MVC application. Why?

To resolve the 404 error issues on secondary pages of a ASP .NET MVC applications, you will need...

My site is showing the following error: HTTP Error 503. The service is unavailable.

The error HTTP Error 503. The service is unavailable. generally means that your application pool...