Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TFS NuGet Packager:[错误]';System.Runtime';已经为';定义了依赖项;微软.NETCore.Platforms';_Tfs_Nuget - Fatal编程技术网

TFS NuGet Packager:[错误]';System.Runtime';已经为';定义了依赖项;微软.NETCore.Platforms';

TFS NuGet Packager:[错误]';System.Runtime';已经为';定义了依赖项;微软.NETCore.Platforms';,tfs,nuget,Tfs,Nuget,我正在使用该任务作为TFS 2017构建过程的一部分,为类库创建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/R

我正在使用该任务作为TFS 2017构建过程的一部分,为类库创建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包,一切正常

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

您知道如何修复此错误吗?

如中所述,此错误已在新的多用途NuGet命令中修复,该任务取代了旧的NuGet Packager任务,并默认使用NuGet 4.0

使用NuGet命令TFS任务代替NuGet打包程序TFS任务修复了错误。与NuGet命令任务一起使用的参数有:

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