1

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?

4

1 回答 1

0

作为一种解决方法,请尝试通过将以下字符串添加到项目文件中来禁用自动参数化并检查它是否有效。(确保将标签放在正确的位置,例如您在场景中提到的:在发布构建属性组下)

<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>

此外,请参考此博客以检查这是否有助于您的故障排除:使用 VSTS 部署到 Azure 应用服务时使用 XML 转换

于 2020-02-07T10:05:25.113 回答