azure-devops - AutoParameterizationWebConfigConnectionStrings not working in azure devops release pipelines
问题描述
I am setting up build and release pipelines in Azure DevOps for a new project. I mirrored this off an existing project that has been working for a while now.
The problem is that the connection strings aren't transforming by XML or by the release pipeline variable substitution.
I have the following arguments passed during the build phase:
/p:AutoParameterizationWebConfigConnectionStrings=false /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"
Yet, in both projects when I release with system.debug=true, I see this error:
ConnectionString attributes in Web.config is parameterized by default. Note that the transformation has no effect on connectionString attributes as the value is overridden during deployment by 'Parameters.xml or 'SetParameters.xml' files. You can disable the auto-parameterization by setting /p:AutoParameterizationWebConfigConnectionStrings=False during MSBuild package generation.
I do have both the XML transformation and the XML variable substitution boxes checked on the release pipeline.
I've tried to get this working all day to no avail.
Anyone have any other thoughts or suggestions?
解决方案
作为一种解决方法,请尝试通过将以下字符串添加到项目文件中来禁用自动参数化并检查它是否有效。(确保将标签放在正确的位置,例如您在场景中提到的:在发布构建属性组下)
<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>
此外,请参考此博客以检查这是否有助于您的故障排除:使用 VSTS 部署到 Azure 应用服务时使用 XML 转换
推荐阅读
- unity3d - 如何在增强现实中显示模型放置位置的跟踪线?
- node.js - 应用程序发生错误,无法提供您的页面。
- php - 如何将保存的值从数据库显示到所见即所得的 tinymce
- java - 计算字符串出现次数的最佳方式/数据结构
- java - java中元空间区域或permgen的引用在哪里
- python - 如何遍历文本文件的每一行并使用 python 获取这些行的情感?
- android - 防止用户从 android 应用程序的应用程序设置中清除商店首选项。?
- android - 无法解析方法“arrayUnion”-firestore
- java - maven - mvn 测试失败:杀死自我 fork JVM。Maven进程死了
- ios - OPGFeedbackSDK:如何使用 OnePoint SDK 对移动调查进行身份验证?