glutz
glutz

Reputation: 1959

How Can I Host A WCF App In IIS?

I'm following Microsoft's tutorial on the topic here but it's not working and several items are unclear to me. http://msdn.microsoft.com/en-us/library/ms733766.aspx

  1. In step 2 it says, "ensure that ASP.NET has access to the contents of the folder". How can i do this?
  2. Is it correct that the .cs code not be compiled? I've never ran .cs as a script of any kind.

Here is my error:

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

Thanks.

Upvotes: 6

Views: 10747

Answers (4)

ssug89
ssug89

Reputation: 249

  1. Open IISManager and go to handler mappings and right click on the static file and select "Revert to Parent"

Upvotes: 1

kyz
kyz

Reputation: 21

In step 2 it says, "ensure that ASP.NET has access to the contents of the folder". How can i do this?

I think it mean make sure your folder are accessible by the IIS_IUSRS
Check the publish folder properties -> Security tab -> group or user name.

Make sure the app is using application pool with correct .net framework version. normally I will just set .net framework v4.0.30319

Upvotes: 0

Adarsh Kumar
Adarsh Kumar

Reputation: 1160

You can Host a WCF App/Service in IIS as you host simple website. It seems to me that you are trying to access/browse .cs file. If so, then it is not possible as it is code file. You should browse only your service file i.e. .svc file.

You can refer http://adarshdchaurasia.wordpress.com/2013/09/26/create-restful-wcf-service-api-using-get-post-step-by-step-guide/ to create a WCF service.

Please ensure that:

  • You have .Net framework 4.0 installed and enabled on your machine. If not, install or try to re-install. Sometimes re-installation fix the unknown settings problem we accidentally create.
  • First try to host a simple demo web site to check if the problem is with your WCF application or with hosting process your are
    following.

Upvotes: 0

wizzardz
wizzardz

Reputation: 5874

Could you please ensure that your apppool in which your site is running in "Integrated" mode rather than Classic.

If the problem is not resolved after doing this, try to register your IIS with .netv4.0

For doing that

Go to Command Prompt
Go to the location C:\Windows\Microsoft.NET\Framework\v4.0.30319
Register the IIS using aspnet_regiis -i command

Upvotes: 14

Related Questions