[c#] HTTP 404 when accessing .svc file in IIS

I recently created a WCF service that works fine when tested from Visual Studio 2008. but when I deploy the project to IIS and I try to access the .svc file from IIS, I get this error :

"Server Error in '/' Application.The resource cannot be found.  "

I've been having this issue for the past 4 days .

in the Handler Mappings of IIS Manager, I can see two entries for .svc :

svc-Integrated and svc-ISAPI-2.0

This question is related to c# .net wcf

The answer is


There are 2 .net framework version are given under the features in add role/ features in server 2012

a. 3.5

b. 4.5

Depending up on used framework you can enable HTTP-Activation under WCF services. :)


None of the above solutions resolved this error for me. I had to set the following in web.config:

system.servicemodel > bindings > webHttpBinding > binding:
<security mode="Transport">
  <transport clientCredentialType="None" />
</security>

I would like to take this opportunity to CURSE Microsoft once again for creating such a huge mess with the .NET Framework and making developer lives so miserable for so long!


I've had the same problem today.

For me, the solution was to go into IIS, right-click on the new Web Site name, select Properties, ASP.Net, and change the ASP.Net version from "1.1.4322" (which it had set as the default) to 2.0.50727.

Once I'd done that, I could right-click on the .svc file, click on "Browse" and see the friendly Service webpage.


In my case Win 10. the file applicationHost.config is corrupted by VS 2012. And you can get the copy the history of this file under C:\inetpub\history. Then restart IIS and it works properly.


In my case, the error was caused by incorrect mapping settings in the file applicationhost.config (\System32\inetsrv\config). For some reason, Visual Studio 2013 corrupted it while creating a virtual directory in IIS. The fix was to manually edit the sites section in the file.


What worked for me, On Windows 2012 Server R2:

WCF HTTP 404

Thanks goes to "Aaron D"


Adding the .svc suffix as allowed in request filtering did the trick for me.


I see you've already solved your problem - but for posterity:

We had a similar problem, and the SVC handler was already correctly installed. Our problem was the ExtensionlessUrl handler processing requests before they reached the SVC handler.

To check this - in Handler Mappings in IIS Manager at the web server level, view the list of handlers in order (it's an option on the right-hand side). If the various ExtensionlessUrl handlers appear above the SVC handlers, then repeatedly move them down until they're at the bottom.


I found these instructions on a blog post that indicated this step, which worked for me (Windows 8, 64-bit):

Make sure that in windows features, you have both WCF options under .Net framework are ticked. So go to Control Panel –> Programs and Features –> Turn Windows Features ON/Off –> Features –> Add Features –> .NET Framework X.X Features. Make sure that .Net framework says it is installed, and make sure that the WCF Activation node underneath it is selected (checkbox ticked) and both options under WCF Activation are also checked.
These are:
* HTTP Activation
* Non-HTTP Activation
Both options need to be selected (checked box ticked).

I had to add the extension .svc to the allowed extensions in the request filtering settings (got 404.7 errors before).

enter image description here


This can also become an issue after enabling IIS 6 Management Compatibility in windows 10. Setting the framework HTTP Activation under WCF Services will fix the problem.


Verifies that you directory has been converted into an Application is your IIS.


Examples related to c#

How can I convert this one line of ActionScript to C#? Microsoft Advertising SDK doesn't deliverer ads How to use a global array in C#? How to correctly write async method? C# - insert values from file into two arrays Uploading into folder in FTP? Are these methods thread safe? dotnet ef not found in .NET Core 3 HTTP Error 500.30 - ANCM In-Process Start Failure Best way to "push" into C# array

Examples related to .net

You must add a reference to assembly 'netstandard, Version=2.0.0.0 How to use Bootstrap 4 in ASP.NET Core No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization .net Core 2.0 - Package was restored using .NetFramework 4.6.1 instead of target framework .netCore 2.0. The package may not be fully compatible Update .NET web service to use TLS 1.2 EF Core add-migration Build Failed What is the difference between .NET Core and .NET Standard Class Library project types? Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies Nuget connection attempt failed "Unable to load the service index for source" Token based authentication in Web API without any user interface

Examples related to wcf

Create a asmx web service in C# using visual studio 2013 WCF Exception: Could not find a base address that matches scheme http for the endpoint WCF Service, the type provided as the service attribute values…could not be found WCF error - There was no endpoint listening at How can I pass a username/password in the header to a SOAP WCF Service The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM' Content Type application/soap+xml; charset=utf-8 was not supported by service The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8) maxReceivedMessageSize and maxBufferSize in app.config how to generate a unique token which expires after 24 hours?