Tôi có một dự án ASP.NET sử dụng IIS. Trang web IIS được cấu hình để sử dụng tên máy chủ liên kết tùy chỉnh. Tệp dự án chứa các cài đặt sau:
...
<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>
...
Khi dự án được định cấu hình theo cách như vậy, tôi có thể truy cập trang web từ đó http://custom.host.name/
và VS tự động gắn vào quy trình công nhân IIS khi gỡ lỗi.
Khi tôi tải lại dự án (bằng cách đóng / mở lại giải pháp hoặc bằng cách dỡ / tải lại trong menu ngữ cảnh của dự án), điều gì đó không mong muốn sẽ xảy ra. Dự án không tải được, (load failed)
được hiển thị ở bên phải tên dự án trong trình khám phá giải pháp và hộp thông báo được hiển thị với thông báo sau (nó cũng được hiển thị trong cửa sổ Đầu ra):
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.
Tôi đã thử xóa cấu hình trang web dự án khỏi applicationhost.config
tệp IIS Express , nhưng không giúp được gì.
Tôi không gặp sự cố này khi ánh xạ dự án tới Ứng dụng IIS trong trang web mặc định.
Phiên bản VS là Ultimate 2012 Update 3.