I am using the NuGet Packager task as part of my TFS 2017 build procedure to create a NuGet package for a class library. I am getting the error:
[error]'System.Runtime' already has a dependency defined for 'Microsoft.NETCore.Platforms'. [error]System.Exception: Unexpected exit code 1 returned from tool NuGet.exe
I set the following task parameters:
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)
I am using the same TFS task to create another NuGet package for another class library, and everything works fine.
I tried solutions provided by the following stackoverflow questions, but nothing worked.
NuGet: 'X' already has a dependency defined for 'Y'
Any idea on how to fix this error?