1. 设置 IISExpress 配置文件 applicationhost.config

    VS2015 :这个配置文件 在工程目录下的 .vs/config 隐藏目录

    其他版本 :在用户目录中的 IISExpress 文件夹下

    将属性  bindingInformation="*:7632:localhost* 改为 bindingInformation="*:7632:*“

<site name="Com.Huidu.WebSite" id="2">
   <application path="/" applicationPool="Clr4IntegratedAppPool">
     <virtualDirectory path="/" physicalPath="E:\Subversion\hdp\branches\trunk-Austrialia\Com.Huidu.WebSite\Com.Huidu.WebSite" />
   </application>
   <bindings>
     <binding protocol="http" bindingInformation="*:7632:*" />
  </bindings>
</site>

 

2. 以管理员身份进入终端并执行以下命令

netsh http add urlacl url=http://*:7632/ user="NT AUTHORITY\INTERACTIVE"

netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=7632 profile=private remoteip=localsubnet action=allow

 

配置完成后通过 VS 调试 web 应用时就可通过局域网访问了。

 

3. 若需要撤销局域网访问功能,可在命令行中执行以下指令:

netsh http delete urlacl url=http://*:7632/
netsh advfirewall firewall delete rule name="IISExpressWeb"

 

相关文章:

  • 2021-11-24
  • 2021-11-30
  • 2021-12-05
  • 2021-11-23
  • 2022-01-16
  • 2021-12-27
猜你喜欢
  • 2021-11-15
  • 2022-12-23
  • 2021-07-24
  • 2021-08-04
  • 2021-11-30
  • 2021-11-02
  • 2021-11-12
相关资源
相似解决方案