11

I just created a WCF Service Application in VS2013 with framework 3.5. for exposing some methods I have in a class library project.

Everything went fine but when I tried to see if the service runs, it doesn't. Instead I got the next error.

HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.

Most likely causes: The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try: If you want to serve this content as a static file, add an explicit MIME map.

I have dealt with it on IIS, but now in IIS Expres I'm kinda lost.

I don't have IIS installed on this machine since I'm using a remote one, but I need to debug some things and I'm stuck. Thanks for any help.

I also did run servicesmodelreg -i with visual command prompt, but error persists.

UPDATE

It may be usefull to clarfy it only happens in IIS Express so it is impacting development. I have VS2013 updated to the latest patch running on Win 8.1 64bit

Ricker Silva
  • 1,137
  • 4
  • 17
  • 37

3 Answers3

19

Try to run "C:\Program Files\IIS Express>Wscript.exe WCF35Setup.js install" that is a script for enabling WCF 3.5 service on IIS Express. Reference : http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-75-express-readme

Michael L Perry
  • 7,327
  • 3
  • 35
  • 34
7

Seems WCF mapping are not registered with IIS.

To solve the above error:

  • Navigate to "

    %SYSTEMROOT%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation

" at the Visual Studio command prompt.

  • Execute "servicemodelreg -i" to install the mappings manually.

For more details refer :ServiceModel Registration Tool (ServiceModelReg.exe) on MSDN.

-

Alternatively,

enable HTTP Activation for WCF services in Windows features.

  1. Click the Start button, and then click Control Panel.
  2. Click Programs, and then click Programs and Features.
  3. On the Tasks menu, click Turn Windows features on or off.
  4. Select the WCF Non-Http Activation Components box and save the setting.

enter image description here

Source :

http://msdn.microsoft.com/en-us/library/ms732012(v=vs.110).aspx

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
  • I have done that, and I suppose if I deploy it to my IIS, it should work... I´ll give it a try just to see how linked are IIS and IISExpress. This issue is only on debugging. The component is already deployed on customer servers and working smooth – Ricker Silva Jul 07 '14 at 20:45
  • Might be WCF mapping are not registered with IIS on your machine but since it is good on customer server where is hosted it works... – Pranav Singh Jul 08 '14 at 05:23
  • it is also causing that I can not add a service reference on dev time. I post that issue here http://stackoverflow.com/questions/24559558/vs2013-cannot-add-wcf-service-reference-in-solution – Ricker Silva Jul 08 '14 at 19:15
  • 1
    Enabling HTTP Activation solved my problem. Thanks – Farkhod Oct 11 '21 at 02:07
2

After trying all the recommended solutions suggested here up to this point:

  • servicemodelreg -i
  • Wscript.exe WCF35Setup.js install
  • enable HTTP Activation

And a few others suggested elsewhere:

  • Run Visual Studio as Admin
  • Use "Local IIS" instead of IIS Express

I finally determined what my issue was. The WCF code was targeting .NET framework 3.0, and I had not enabled IIS support for 3.0/3.5! The solution was simple. Enable ".NET Extensibilty 3.5 and ASP.NET 3.5".

Enable Features

N1njaB0b
  • 688
  • 6
  • 11