简体   繁体   中英

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. I just want the deployed to use web.config. I thought by not enabling transformation it would just values in 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. This is handled by msbuild in your csproj file when you compile the solution in Release or Debug configurations.

For example, compiling your solution locally with the release parameter will accomplish the same result that you're seeing in your build pipeline:

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. Eg web.Staging.config or web.Production.config where your pipeline has Staging and Production stages. This is accomplished by enabling the Xml transformation option.

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. To leverage this option, the documentation outlines that you must represent the values in the config file with a __VARIABLE-NAME__ syntax.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM