How can I host a WCF application in IIS?

I am following Microsoft's tutorial on this topic, but it does not work, and several elements are not clear to me. http://msdn.microsoft.com/en-us/library/ms733766.aspx

  • Step 2 says, "make sure ASP.NET has access to the contents of the folder." How can i do this?
  • Is it right that the .cs code is not compiled? I have never run .cs as a script of any type.

Here is my mistake:

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

Thanks.

+6
source share
4 answers

Could you make sure that your pool, in which your site operates in the " Integrated " mode, and not Classic .

If the problem persists after this, try registering your IIS with .netv4.0

For this

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

+13
source
  • Open IISManager and go to the handler mappings and right-click on the static file and select Restore to Parent
+1
source

You can host the WCF application / service in IIS as you host a simple website. It seems to me that you are trying to access the .cs file. If so, then this is not possible, as it is a code file. You should only view your service file, i.e. .Svc file.

You can refer to 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 make sure:

  • You have installed and enabled .Net framework 4.0 on your computer. If you do not install and do not try to reinstall. Sometimes reinstalling fixes unknown configuration problems that we accidentally created.
  • First, try hosting a simple demo website to see if the problem with your WCF application or hosting process is as follows.
0
source

Step 2 says, "make sure ASP.NET has access to the contents of the folder." How can i do this?

I think it means your folder is accessible using IIS_IUSRS
Check publication publication properties β†’ Security tab β†’ group or username.

Verify that the application uses the application pool with the correct version of the .net framework. I usually just install .net framework v4.0.30319

0
source

Source: https://habr.com/ru/post/954743/


All Articles