Friday, March 6, 2015

The requested content appears to be script and will not be served by the static file handler – WCF IIS Hosting error

This is one of the most confusing error you get while hosting WCF service in IIS. Solution is simple but the error description completely misleads you to think in all the direction.
Below is the exact error,

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

image

The reason for the error is when you host a WCF service which is developed in .NET Framework 4.0 or 4.5 then while deploying by default IIS select .NET Framework 2.0.

In order to resolve this issue go to IIS and change the .NET Framework to the version which was used to develop your WCF service.
The exact step would be,

Press Start button  + R  and then type inetmgr.

Expand your server and then click on Application Pools

In the list of application pools select the application pool which is being used by your new WCF service.

Here you would have already noticed the wrong framework associated with your WCF service.

Just double click on the WCF Service name and change the .NET Framework version.

image
Click OK to save the changes. Now you browse your WCF service all your issues with your WCF service hosting error would have resolved.

1 comment:

Naviya Nair said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from .Net Core Training in Chennai. or learn thru .Net Core Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
or Es6 Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.