我有一个ASP.NET项目,该项目使用IIS.IIS站点配置为使用自定义绑定主机名.项目文件包含以下设置:
...
<UseIISExpress>false</UseIISExpress>
...
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8662</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://custom.host.name/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl></CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
...
当以这种方式配置project时,我可以从http://custom.host.name/
访问该站点,并且在调试时VS会自动连接到IIS工作进程.
当我重新加载项目时(通过关闭/重新打开解决方案或通过在项目上下文菜单中卸载/重新加载),发生了一些意外情况.项目加载失败,解决方案资源管理器中项目名称右侧显示(load failed)
,并显示带有以下消息的消息框(它也显示在输出窗口中):
The URL 'http://custom.host.name/' for Web project 'Some.Asp.Net.Project'
is configured to use IIS Express as the web server but the URL is currently
configured on the local IIS web server. To open this project, you must use
IIS Manager to remove the bindings using this URL from the local IIS web server.
我已try 从IIS Express applicationhost.config
文件中删除项目站点配置,但无济于事.
在将项目映射到默认站点下的IIS应用程序时,我没有遇到此问题.
VS版本是旗舰版2012更新3.