我有三个自定义生成配置{开发,QS,珠三角}。所以,我有三个应用程序的configs {Dev.config,Qs.config,Prd.config}。我知道如何编辑的.csproj文件,以输出正确的基础上,当前构建配置。
I have three custom build configurations { Dev, Qs, Prd }. So, I have three app configs { Dev.config, Qs.config, Prd.config }. I know how to edit the .csproj file to output the correct one based on the current build configuration.
<Target Name="AfterBuild">
<Delete Files="$(TargetDir)$(TargetFileName).config" />
<Copy SourceFiles="$(ProjectDir)$(Configuration).config" DestinationFiles="$(TargetDir)$(TargetFileName).config" />
</Target>
我的问题是,我需要有 6 生成配置{开发,QS,珠三角}×{调试,发布}。我需要支持调试和释放设置(优化,PDB,等等)的每个环境。但是,应用程序的配置值不调试/版本之间切换。
My problem is, I need to have six build configurations { Dev, Qs, Prd } x { Debug, Release }. I need to support the debug and release settings (optimizations, pdb, etc) for each environment. However, the app config values don't change between debug/release.
我如何保持构建脚本尽可能通用和只使用三个应用程序的configs?我不想硬code太多有条件的字符串。
How do I keep the build script as generic as possible and use only the three app configs? I don't want to hard code too many conditional strings.
沿东西线
<PropertyGroup Condition="'$(Configuration)'=='Dev_Debug' OR '$(Configuration)'=='Dev_Release'" >
<CfgFileName>Dev</CfgFileName>
</PropertyGroup>
<!-- similar for Qs & Prd -->
<Target ...>...$(CfgFileName).config...
上一篇:更快的深克隆更快