简体   繁体   English

在IIS上启动ASP.NET Restful Web服务

[英]Starting a ASP.NET restful webservice on IIS

I have developed a restful web service using ASP.NET, and while using the Visual Studio environment, it worked like a charm with IIS Express. 我已经使用ASP.NET开发了一个宁静的Web服务,并且在使用Visual Studio环境时,它与IIS Express一样具有吸引力。 The service itself is a complementary feature and will have to run on every machine on which our product is installed. 该服务本身是一项补充功能,必须在安装我们产品的每台计算机上运行。

I have therefore created a new directory webservice , which holds the web.config and the Global.asax file, as well as a directory bin , which holds the RestulWebservice.dll file. 因此,我创建了一个新目录webservice ,其中包含web.configGlobal.asax文件,以及一个目录bin ,其中包含RestulWebservice.dll文件。

目录

I then have setup a new web page on the IIS, rooting at C:\\inetpub\\wwwroot . 然后,我在IIS上设置了一个新网页,其根目录为C:\\ inetpub \\ wwwroot The web page itself is hosting a web application, based in C:\\inetpub\\wwwroot\\RestfulWebservice (which holds the files described above). 网页本身托管基于C:\\ inetpub \\ wwwroot \\ RestfulWebservice (包含上述文件)的Web应用程序。

在此处输入图片说明

However, if I startup the IIS and visit http://localhost:80/RestfulWebservice , all I am getting is an error 403.14, stating that I may not inspect the contents of this folder unless I allow IIS to do so. 但是,如果我启动IIS并访问http://localhost:80/RestfulWebservice ,我得到的只是错误403.14,指出除非允许IIS,否则我可能不会检查此文件夹的内容。 If I choose to allow this, I am simply presented with the contents of the folder, not the service itself. 如果选择允许,则只显示文件夹的内容,而不显示服务本身。

If I try to access a resource of the restful web service directly (ie http://localhost:80/RestfulWebservice/Home , I get a direct 404.0 error, telling me that the resource does not exist) 如果我尝试直接访问http://localhost:80/RestfulWebservice/Home Web服务的资源(即http://localhost:80/RestfulWebservice/Homehttp://localhost:80/RestfulWebservice/Home收到直接404.0错误,告诉我该资源不存在)

What am I doing wrong here, it can impossibly be this hard to get a compiled library ASP.NET web service to run on the IIS, it works like a charm on IIS express. 我在做什么错在这里,它可以是不可能这样很难得到一个编译库ASP.NET Web服务在IIS上运行,它的工作原理就像IIS Express中的魅力。

c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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