简体   繁体   English

为什么Azure DevOps Release Transforming Web.config

[英]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.当您在ReleaseDebug配置中编译解决方案时,这由 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.configweb.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.

相关问题 使用 Azure DevOps 部署时,在 web.config 中设置发布名称 - Set Release name in web.config when deploying with Azure DevOps 在 Azure 管道发布期间替换 Web.config 中的连接字符串 - Replacing the connection string in the Web.config during Azure pipeline release 在发布管道期间将发布号添加到 Web.config - Adding Release Number to Web.config during release pipeline Azure 发布管道:我可以部署到多台服务器,每台服务器都应用了不同的 web.config 转换,只有一个阶段。? - Azure Release Pipeline: Can I deploy to multiple servers, each with a different web.config transform applied, with a single stage.? .NET 5 - web.config 用于上传大文件 - Azure App Services - .NET 5 - web.config for uploading large files - Azure App Services Azure DevOps 发布管道中的 Bicep - Azure Bicep in DevOps release pipeline Azure DevOps 订购发布阶段 - Azure DevOps ordering the release stages Azure Pipeline 部署到 AWS Elastic Beanstalk 任务失败,因为缺少 web.config - Azure Pipeline Deploy To AWS Elastic Beanstalk Task failes because web.config is missing 将 Azure 应用服务 web.config 更新为 load.ttf 字体文件 - Updating Azure App Service web.config to load .ttf font files Azure devops 发布编辑批量 110 - Azure devops release edit bulk 110
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM