[英]Unable to host web service in IIS
I've been working on a webservice, and testing it by viewing it in a browser directly from VS2012, but now I need to host it in IIS, and for some reason, it simply will not work. 我一直在研究Web服务,并通过直接从VS2012在浏览器中查看它来对其进行测试,但是现在我需要将其托管在IIS中,由于某种原因,它根本无法工作。
I've tried publishing it as a new web application under my local IIS. 我尝试将其发布为本地IIS下的新Web应用程序。 It shows up as it should, but when I switch to Content View in IIS, right-click the
MyService.svc
file, and choose "browse", all I get is a new web-browser window saying the site was not found. 它按预期显示,但是当我切换到IIS中的“内容视图”时,右键单击
MyService.svc
文件,然后选择“浏览”,我得到的只是一个新的Web浏览器窗口,提示未找到该站点。
To check if the problem was relating to something in my service, or was general, I tried creating a new test-service from a VS project template (a new WCF Service Application ), which i compiled, ran in my browser nicely, then tried to publish to IIS, with the same result. 为了检查问题是否与服务中的某些问题有关,或者是一般性的,我尝试从VS项目模板(新的WCF服务应用程序 )创建新的测试服务,该模板经过编译,很好地在浏览器中运行,然后尝试发布到IIS,结果相同。
A little extra info: 一些额外的信息:
I've been able to publish a website in IIS recently, and it works fine - I really thought the process was supposed to be just about the same for a service, but apparently I'm missing something. 我最近已经能够在IIS中发布网站,而且效果很好-我真的以为服务的过程应该差不多,但是显然我遗漏了一些东西。
Update : A little extra info in response to comments below: 更新 :一些额外的信息,以回应以下评论:
.asmx
file, only a .svc
file, a web.config
, and a bin/
folder in the folder where the service is published. .asmx
文件,只有.svc
文件, web.config
和bin/
文件夹。 Any tips as to what I can try in order to resolve this will be greatly appreciated.... 关于我可以尝试解决此问题的任何技巧将不胜感激。
For the record, this was what solved the problem for me: 记录下来,这就是为我解决问题的原因:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.