转到C:\用户{用户名} \文档\ IISExpress \ CONFIG并打开对ApplicationHost.config文件。
搜索文档中的<sites>
标签。您会看到类似于以下的一些行。
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:8080:localhost" />
</bindings>
</site>
如下替换线<binding protocol="http" bindingInformation="*:8080:localhost" />
。
<binding protocol="http" bindingInformation="*:{required_port_number}:*" />
我想你甚至可以删除bindingInformation
的*
马克。
然后重新启动IIS服务器(使用任务管理器删除所有的IIS服务器相关业务,以及去C:\ Program Files文件\ IIS快递文件夹,运行iisexpress.exe:您可能需要以管理员身份运行)。
控制台将打开,如果一切顺利,将显示以下行。
Successfully registered URL "http://*:{required_port_number}/" for site "Website1" application "/" ...
在浏览器同时检查所需的网址能否正常工作了。
Here's a very useful resource...
您应该将答案部分提取到答案并接受它。如果您阅读其他文章,这就是FAQ的格式。 –
感谢您的提示。 –