Cas*_*ton 5 debugging wcf http-status-code-503 visual-studio-2013
我有一个WCF REST服务,它在使用IISExpress和这个url时调试并完美运行:
http://localhost:<portnumber>
Run Code Online (Sandbox Code Playgroud)
但是,由于各种原因,我需要它也可以使用IIS Express和这个URL:
http://<ip address>:<portnumber>
Run Code Online (Sandbox Code Playgroud)
当我最初尝试时,我收到HTTP错误400:错误的请求.然后我使用谷歌并最终在这里:连接到Visual Studio通过局域网调试IIS Express服务器
那个帖子问了一个完全相同的问题,答案让我在那里的一部分.遵循该主题中所有最优秀的建议,我做了以下工作:
编辑IISExpress Host.config:
1:打开%USERPROFILE%\ My Documents\IISExpress\config\applicationhost.config文件.
2:更改了所有这17行:
<binding protocol="http" bindingInformation="*:8080:localhost" />
Run Code Online (Sandbox Code Playgroud)
看起来像这样:
<binding protocol="http" bindingInformation="*:8080:*" />
Run Code Online (Sandbox Code Playgroud)
(所有17条线路的端口号不同)
视觉工作室:
关闭,重新打开但以管理员身份运行
Windows防火墙:
添加了有问题的端口以允许传入连接
CMD:
netsh http add urlacl url=http://*:XXXXX/ user=Everyone
Run Code Online (Sandbox Code Playgroud)
执行该命令,其中XXXXX是端口号.
现在,当我开始调试并转到此URL时:
http://<ip address>:<portnumber>
Run Code Online (Sandbox Code Playgroud)
而不是"HTTP错误400:错误请求",我现在得到"HTTP错误503.服务不可用".
这是进步,因为浏览器现在至少打到了IISExpress,对吧?但我现在还不确定如何通过这个503错误.我一直在谷歌搜索该错误一段时间,但没有什么是我想要做的具体.
有任何想法吗?
弄清楚了。而不是这个:
<binding protocol="http" bindingInformation="*:8080:*" />
Run Code Online (Sandbox Code Playgroud)
将其更改为:
<binding protocol="http" bindingInformation="*:8080:" />
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6105 次 |
最近记录: |