9

我在Visual Studio 2015年的ASP.net MVC 5解決方案的工作,我有以下web.config如何重命名web.config文件轉換

web config transforms

如何重新命名這些是

  • Web.Integration.config
  • Web.Staging.config
  • Web.Production.config

當我右鍵單擊這些,我沒有得到重命名選項!

回答

13

您可以複製文件,重命名它們並手動編輯.csproj的文件,包括他們(更換所產生的)象下面這樣:

<Content Include="Web.Integration.config"> 
    <DependentUpon>Web.config</DependentUpon> 
    <SubType>Designer</SubType> 
</Content> 
<Content Include="Web.Staging.config"> 
    <DependentUpon>Web.config</DependentUpon> 
    <SubType>Designer</SubType> 
</Content> 
<Content Include="Web.Production.config"> 
    <DependentUpon>Web.config</DependentUpon> 
    <SubType>Designer</SubType> 
</Content> 

可惜的是我沒有找到一種方法,通過視覺來acomplish這工作室。

+0

請務必在配置管理器中檢查沒有任何項目「未選中」構建。這可能會浪費很多時間,如果您稍後才注意到 –

0

我發現爲我工作的只是刪除調試和發佈,然後創建新的。爲我省去了很多擔憂,並且引用了一些懸而未決的錯誤和其他類似的錯誤