【问题标题】:TFS NuGet Packager: [error] 'System.Runtime' already has a dependency defined for 'Microsoft.NETCore.Platforms'TFS NuGet Packager:[错误]“System.Runtime”已经为“Microsoft.NETCore.Platforms”定义了依赖项
【发布时间】:2020-01-18 13:54:00
【问题描述】:

我在 TFS 2017 构建过程中使用 NuGet Packager 任务为类库创建 NuGet 包。我收到错误消息:

[错误]“System.Runtime”已经为“Microsoft.NETCore.Platforms”定义了一个依赖项。 [错误]System.Exception:从工具 NuGet.exe 返回的意外退出代码 1

我设置了以下任务参数:

Path to csproj or nuspec file(s) to pack: .\xxx\xxx.csproj
Package Folder: ./xxx/bin/Release
Include referenced projects: Checked
Automatic package versioning: Use the build number
Configuration to Package: $(BuildConfiguration)

我正在使用相同的 TFS 任务为另一个类库创建另一个 NuGet 包,一切正常。

我尝试了以下 stackoverflow 问题提供的解决方案,但没有任何效果。

TFS2015 NuGet Packager: [error] 'System.Collections' already has a dependency defined for 'Microsoft.NETCore.Platforms'

NuGet: 'X' already has a dependency defined for 'Y'

知道如何解决这个错误吗?

【问题讨论】:

    标签: tfs nuget


    【解决方案1】:

    正如 'System.Globalization' already has a dependency defined for 'Microsoft.NETCore.Platforms' 所报告的,此错误已在新的多功能 NuGet 命令 任务中修复,该任务取代了旧的 NuGet Packager 任务并使用 NuGet 4.0默认。

    使用 NuGet 命令 TFS 任务代替 NuGet Packager TFS 任务修复了错误。 NuGet 命令 任务使用的参数是:

    Command: pack
    Arguments: .\xxx\xxx.csproj 
        -OutputDirectory ./xxx/bin/Release
        -Version $(Build.BuildNumber)
        -IncludeReferencedProjects
        -Properties Configuration=$(BuildConfiguration)
    

    【讨论】:

      猜你喜欢
      • 2017-03-24
      • 1970-01-01
      • 2014-11-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-09
      • 1970-01-01
      • 1970-01-01
      • 2015-03-22
      相关资源
      最近更新 更多