azure devops yaml msbuild不转换web.config

发布于 2025-01-26 01:44:52 字数 592 浏览 2 评论 0 原文

我在Azure DevOps中有一个新的YAML管道,其中包含以下任务:

- task: MSBuild@1
  displayName: 'Build MgzJsonService'
  inputs:
    solution: 'apps/MgzJsonService/MgzJsonService.csproj'
    platform: 'Any CPU'
    configuration: 'Release'
    msbuildArguments: '/p:OutputPath="$(build.artifactstagingdirectory)\MgzJsonService" /t:Build /m /p:RestorePackages=false /consoleloggerparameters:ErrorsOnly '
    clean: true

构建完成并且将工件上传到上传后,我的Web.config不会使用web.release.config进行转换。

但是,当我两次添加相同的任务时,使用输出路径另一个文件夹,第二个构建确实使用web.release.config改变了我的web.config。

为什么只有两次构建项目才能起作用?

I have a new YAML pipeline in Azure DevOps with the following task:

- task: MSBuild@1
  displayName: 'Build MgzJsonService'
  inputs:
    solution: 'apps/MgzJsonService/MgzJsonService.csproj'
    platform: 'Any CPU'
    configuration: 'Release'
    msbuildArguments: '/p:OutputPath="$(build.artifactstagingdirectory)\MgzJsonService" /t:Build /m /p:RestorePackages=false /consoleloggerparameters:ErrorsOnly '
    clean: true

When the build is completed and the artifact is uploaded my Web.Config is not transformed using the Web.Release.config.

But when I add the same task twice, with Output Path another folder, the second build does transform my Web.Config using the Web.Release.config.

Why does it only work if I build the project twice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫轩蝶泪 2025-02-02 01:44:52

在任务中将以下内容添加到MSBuildArguments,已解决此问题:
“/p:usewpp_copywebapplication = true/p:pipelinedippedsonbuild = false”

我从:

Adding the following to the MsBuildArguments in the task fixed the issue:
"/p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false"

I got this answer from: https://stackoverflow.com/a/13128797/2074633

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文