[英]Why is Azure DevOps Release Transforming Web.config
I have a Pipeline set up with continuous integration.我有一个持续集成的管道设置。 In my Release I dont have transformation enabled.
在我的版本中,我没有启用转换。 Source code has a web.config, web.debug.config and web.release.config.
源代码有 web.config、web.debug.config 和 web.release.config。 I just want the deployed to use web.config.
我只希望部署使用 web.config。 I thought by not enabling transformation it would just values in web.config.
我认为通过不启用转换它只会在 web.config 中取值。
The File Transforms & Variable Substitution Options task is not responsible for performing the transforms for *.debug.config
and *.release.config
into your web.config
file. 文件转换和变量替换选项任务不负责将
*.debug.config
和*.release.config
转换为您的web.config
文件。 This is handled by msbuild in your csproj file when you compile the solution in Release or Debug configurations.当您在Release或Debug配置中编译解决方案时,这由 csproj 文件中的 msbuild 处理。
For example, compiling your solution locally with the release parameter will accomplish the same result that you're seeing in your build pipeline:例如,使用 release 参数在本地编译您的解决方案将实现与您在构建管道中看到的相同的结果:
msbuild mySolution.sln /p:Configuration=Release
The File Transforms task is responsible for performing additional transforms that map to config files that correspond to your pipeline's stages.文件转换任务负责执行额外的转换,即 map 到对应于管道阶段的配置文件。 Eg
web.Staging.config
or web.Production.config
where your pipeline has Staging and Production stages.例如
web.Staging.config
或web.Production.config
,其中您的管道具有暂存和生产阶段。 This is accomplished by enabling the Xml transformation option.这是通过启用Xml 转换选项来实现的。
In addition to performing these transformations, it can also inject values from your pipeline variables into those files when you select the XML variable substitution option.除了执行这些转换之外,它还可以在您使用 select XML 变量替换选项时将管道变量的值注入到这些文件中。 To leverage this option, the documentation outlines that you must represent the values in the config file with a
__VARIABLE-NAME__
syntax.要利用此选项, 文档概述了您必须使用
__VARIABLE-NAME__
语法表示配置文件中的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.