Azure Pipelines中的多行字符串 [英] Multiline string in Azure Pipelines

查看:93
本文介绍了Azure Pipelines中的多行字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Azure Pipelines中使用多行YAML字符串吗?

Can I use a multiline YAML string in Azure Pipelines?

使用ASP.NET Core(.NET Framework)模板,我尝试对msbuildArgs进行多重处理,但这没有用.

Using the ASP.NET Core (.NET Framework) template I tried multilining the msbuildArgs but that didn't work.

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: >
       '/p:DeployOnBuild=true /p:WebPublishMethod=Package'
       '/p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true'
       '/p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip"'
       '/p:DeployIisAppPath="Default Web Site"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

MSBUILD:错误MSB1008:只能指定一个项目.
开关:'/p:DeployOnBuild = true

MSBUILD : error MSB1008: Only one project can be specified.
Switch: '/p:DeployOnBuild=true


查看字符串参考文档,关于此主题,我看不到任何内容.


Reviewing the string reference documentation I don't see any about this topic.

推荐答案

我总是使用 YAML数据块过滤运算符像这样

msbuildArgs: >-
  /p:DeployOnBuild=true
  /p:WebPublishMethod=Package
  /p:PackageAsSingleFile=true
  /p:SkipInvalidConfigurations=true
  /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip"
  /p:DeployIisAppPath="Default Web Site"

效果很好,使事情变得清晰而整洁

Works well and makes things crystal clear and neat

这篇关于Azure Pipelines中的多行字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆