小编Igo*_*nov的帖子

VS 2012无法加载使用IIS和自定义绑定主机的项目 - 认为它使用的是IIS Express

我有一个使用IIS的ASP.NET项目.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>
...
Run Code Online (Sandbox Code Playgroud)

当以这种方式配置项目时,我可以从中访问该站点,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 …
Run Code Online (Sandbox Code Playgroud)

asp.net iis iis-express visual-studio-2012

83
推荐指数
3
解决办法
6万
查看次数

标签 统计

asp.net ×1

iis ×1

iis-express ×1

visual-studio-2012 ×1