![](/img/trans.png)
[英]How to deploy a WCF web service in IIS 8.0 using Visual Studio 2012?
[英]Why is IIS 8.0 Express using the old project names after rename in Visual Studio 2012
在命名混亂之后,我的團隊決定重命名一些項目以及該項目中所有現有代碼文件的名稱空間。 (在Visual Studio 2012中)
我們已更改:
畢竟, IIS 8.0 Express仍然堅持使用舊項目名稱作為站點名稱(在本地調試時)。 我怎樣才能解決這個問題?
編輯:真正的問題是: IIS 8.0 Express如何確定站點名稱 ?
這是一個網站的.csproj文件(其中之一)的摘要
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>52143</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:53177/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
...網站名稱一無所有。
問題根本不在項目中。
在applicationhost.config文件(iis.net鏈接)中 ,通常在
(user-dir)\\My Documents\\IISExpress\\config\\applicationhost.config
有一個站點的設置。 只需更改站點的名稱屬性。
<site name="MvcApplication1" id="3">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="(whateverpath)\My Documents\Visual Studio 2012\Projects\MvcApplication1\MvcApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:57733:localhost" />
</bindings>
</site>
您還必須在csproj文件和sln文件(它們基本上是VS使用的帶有文件擴展名的xml文件)中查找和更改這些名稱。
首先也是最重要的是,備份所有內容,以防萬一。 接下來,在csproj / sln文件中執行文本搜索以查找舊名稱(希望它們沒有被稱為“ if”)。 更改名稱,然后嘗試啟動。
我不知道執行此操作的工具或自動方式,但是如上所述,我已經成功地手動完成了此操作。
您是否重新配置了IIS Express? 在項目屬性的Web選項卡上,單擊“創建虛擬目錄”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.