Asp.net-Mvc-5

如何重命名 web.config 轉換

  • May 3, 2018

我在 Visual Studio 2015 中使用 ASP.net MVC 5 解決方案。我有以下內容web.config

網路配置轉換

我如何將它們重命名為

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

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

您可以復製文件,重命名它們並手動編輯 .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>

不幸的是,我沒有找到通過視覺工作室完成此任務的方法。

引用自:https://stackoverflow.com/questions/38371196