如何从yml文件中的nuget恢复任务中过滤.wixproj?

问题描述 投票:0回答:1

在我的 yml 构建文件中,我有一个 nuget 任务,它可以恢复我的 sln 的所有 nuget 包,但是该 sln 中有一个 wix 项目引发以下错误。 “NU1503:跳过项目‘项目位置’的恢复项目文件可能无效或缺少恢复所需的目标”

.wixproj 没有任何 nuget 包,因此我希望能够从 nuget 恢复命令任务中忽略它。我该怎么做?

当前的 nuget 恢复任务看起来像这样......

-task: NuGetCommand@2
inputs:
restoreSolution: ‘path/*.sln’

我尝试过以各种方式抑制警告,但似乎没有效果。

nuget azure-pipelines wix nuget-package-restore
1个回答
0
投票

您可以使用以下 yaml 仅通过

.csproj
恢复项目。

- task: NuGetCommand@2
  inputs:
    command: 'restore'
    restoreSolution: '**/*.csproj'

您也可以参考这个类似的问题跳过项目“SetupWix.wixproj”的恢复。项目文件可能无效或缺少恢复所需的目标 (NU1503)

© www.soinside.com 2019 - 2024. All rights reserved.