ASP.NET配置文件仅适用于某些构建配置

时间:2019-05-12 02:03:30

标签: asp.net-mvc configuration web-config app-config

我在开发中的应用程序配置中使用File属性,允许开发人员保留自己的本地连接和设置:

<appSettings file="Local.AppSettings.config">
   <!-- non-local settings here -->
</appSettings>

我想将其保留在调试版本中,但是我们有一个在CI服务器上运行的Integration版本,在这里我不想处理多余的文件,而是可以将所有Integration版本设置保留在“真实” web.config。

是否只能在某些构建配置中使用File属性?

因此:

<!-- dev version -->
<appSettings file="Local.AppSettings.config">
  <!-- non-local settings here, local settings in separate file -->
</appSettings>

<!-- integration version -->
<appSettings>
  <!-- all settings here, no additional files used -->
</appSettings>

0 个答案:

没有答案
相关问题