iis express custom hostname

使用vs 2017 iisexpress 调试web项目是如果项目绑定某个域名

这时候就需要编辑

1
$(solutionDir)\.vs\config\applicationhost.config

找到文件中site 节点

1
2
3
4
5
6
7
8
<site name=”MyWebApp” id=”2”>
<application path=”/“ applicationPool=”Clr4IntegratedAppPool”>
<virtualDirectory path="/" physicalPath="rpoject root path" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:12345:customerhostname" />
</bindings>
</site>

然后配置项目属性 更改project url .