【问题标题】:MS build in Azure devops - where to input theAzure devops 中的 MSbuild - 在哪里输入
【发布时间】:2022-08-10 15:19:53
【问题描述】:

我正在尝试在管道中声明 VersionAssembly 和 InformationalVersion,这是代码:

  - task: MSBuild@1
    inputs:
      solution: \'My solution.sln\'
      configuration: \'Release\'
      msbuildArguments: \'-t:build -restore /p:VersionAssembly=0.0.0.7 /p:Version=0.0.0.7 /p:VersionSuffix=0.0.0.7\'
    displayName: build sln
    timeoutInMinutes: 10

但是 ms 构建“忽略”我给出的论点,并且我放的版本没有效果。

我究竟做错了什么?

  • \'My solution.sln\' 解决方案 .NET SDK 项目或 \'old style\' 项目中的项目是什么? .NET SDK 项目可以识别和支持AssemblyVersionVersionVersionSuffix 属性。
  • 当不使用内置的MSBuild 任务,而是使用像msbuild \'My solution.sln\' -t:build -restore /p:VersionAssembly=0.0.0.7 /p:Version=0.0.0.7 /p:VersionSuffix=0.0.0.7 /p:Configuration=Release 这样的普通shell 命令时,它是否有效?

标签: visual-studio azure-devops msbuild azure-pipelines


【解决方案1】:

您可以尝试使用 MSbuild 任务来检查它是否有效:

  - task: VSBuild@1
    inputs:
      solution: 'My solution.sln'
      configuration: 'Release'
      msbuildArgs: '-t:build -restore /p:VersionAssembly=0.0.0.7 /p:Version=0.0.0.7 /p:VersionSuffix=0.0.0.7'

更多信息,您可以参考documentation

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-02
    • 1970-01-01
    • 1970-01-01
    • 2020-06-01
    • 2022-06-16
    • 2020-05-08
    • 2022-01-02
    • 1970-01-01
    相关资源
    最近更新 更多