【发布时间】:2017-10-27 09:59:05
【问题描述】:
这是场景: 我有一个网站,其中有一个 web.config 文件以及许多其他特定于环境的配置文件,如 Web.Staging.config/Web.Release.config/Web.OnPrem.config 现在,我已经在我的网站项目的 csproj 文件中配置了 BeforeBuild Target:
<Target Name="BeforeBuild">
<TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
</Target>
当我设置竹子以在发布模式下构建和创建工件时,这很有效(因此部署的应用程序具有来自 web.Release.config 的转换后的 web.config 文件但是,当我更改竹子以使用 OnPrem 构建和创建工件时配置,它不会正确转换 web.config 文件。
当我说设置竹子在 OnPrem 配置中构建时,我实际上已将配置选项更改为以下:
/p:Configuration=OnPrem 而且,我已将 BambooBuild.proj 更改为具有
<ConfigurationToBuild Include="OnPrem|Any CPU">
<FlavorToBuild>OnPrem</FlavorToBuild>
<PlatformToBuild>Any CPU</PlatformToBuild>
</ConfigurationToBuild>
我在这里错过了什么?
【问题讨论】:
标签: c# .net web-config bamboo web.config-transform