Asp.net
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> ...當以這種方式配置項目時,我可以訪問該站點,
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.我曾嘗試從 IIS Express
applicationhost.config文件中刪除項目站點配置,但沒有幫助。在預設站點下將項目映射到 IIS 應用程序時,我沒有遇到此問題。
VS 版本是 Ultimate 2012 Update 3。
以管理員身份打開並沒有解決我的問題。為我解決的問題是打開和文件並確保兩者都設置為.
.csproj``.csproj.user``UseIISExpress``false就我而言,即使
.csproj.user標記為..csproj``SaveServerSettingsInUserFile``false<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <UseIISExpress>false</UseIISExpress> <!-- ... --> </Project>