首先在Visual Studio中打开applicationhost.config文件。地址>>C:\Users\Your User Name\Documents\IISExpress\config\applicationhost.config
然后找到以下代码:
<site name="Your Site_Name" id="24">
<application path="/" applicationPool="Clr4IntegratedAppPool"
<virtualDirectory path="/" physicalPath="C:\Users\Your User Name\Documents\Visual Studio 2013\Projects\Your Site Name" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:Port_Number:*" />
</bindings>
</site>
*)Port_Number:当您在计算机上以IIS Express运行的站点在计算机上运行时,端口号将在浏览器的地址栏中显示,如下所示:localhost:port_number / ...编辑此文件时,将其保存。
在第二步中,您必须以管理员身份运行cmd并键入以下代码:netsh http add urlaclurl=http://*:port_Number/ user=everyone
并按Enter
在第三步中,您必须在防火墙上启用端口
Go to the “Control Panel\System and Security\Windows Firewall”
Click “Advanced settings”
Select “Inbound Rules”
Click on “New Rule …” button
Select “Port”, click “Next”
Fill your IIS Express listening port number, click “Next”
Select “Allow the connection”, click “Next”
Check where you would like allow connection to IIS Express (Domain,Private, Public), click “Next”
Fill rule name (e.g “IIS Express), click “Finish”
我希望这个答案对您有用
此链接中的Visual Studio 2015更新:https :
//johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer
147.102.1.1
然后将其添加到该IP的IIS绑定中,并从移动浏览器电话中对其进行调用。