简体   繁体   中英

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.

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

  1. 打开IISManager并转到处理程序映射并右键单击静态文件并选择“还原为父级”

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 ie .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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM