I am trying to configure a new project to build and create/publish a new package using Visual Studio Team Services. I've done this before using TFS (on-prem) and never had these kinds of issues, but I'm completely stumped on this and not even sure how to proceed with troubleshooting.
The project is fairly simple, really only has 1 class in it (for now). It builds, unit tests run (in the build plan), but when the NuGet Packager
task runs, I get the following output/errors:
******************************************************************************
Starting task: NuGet Packager
******************************************************************************
Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.102.0\tasks\NuGetPackager\0.1.67
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.102.0\tasks\NuGetPackager\0.1.67\NuGetPackager.ps1
tools\nuget.exe pack "C:\a\1\s\src\MyProject.Platform\MyProject.Platform.csproj" -OutputDirectory "C:\a\1\s\packages" -Properties Configuration=debug -version 0.1.0-unstable0011 -Symbols -Verbosity detailed
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
Attempting to build package from 'MyProject.Platform.csproj'.
Packing files from 'C:\a\1\s\src\MyProject.Platform\bin\Debug'.
Add file 'C:\a\1\s\src\MyProject.Platform\bin\Debug\MyProject.Platform.dll' to package as 'lib\net45\MyProject.Platform.dll'
System.InvalidOperationException: 'System.Reactive.Core' already has a dependency defined for 'System.Reactive.Interfaces'.
at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
at NuGet.Manifest.Validate(Manifest manifest)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.OptimizedZipPackage.EnsureManifest()
at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath, IFileSystem expandedFileSystem)
at NuGet.SharedPackageRepository.OpenPackage(String path)
at NuGet.LocalPackageRepository.GetPackage(Func`2 openPackage, String path)
at NuGet.LocalPackageRepository.<>c__DisplayClass13.<FindPackage>b__f(String path)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at NuGet.LocalPackageRepository.FindPackage(Func`2 openPackage, String packageId, SemanticVersion version)
at NuGet.LocalPackageRepository.FindPackage(String packageId, SemanticVersion version)
at NuGet.SharedPackageRepository.FindPackage(String packageId, SemanticVersion version)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at NuGet.CommandLine.ProjectFactory.<>c__DisplayClass92_0.<AddFiles>b__0(PackageReference reference)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at NuGet.CommandLine.ProjectFactory.AddFiles(PackageBuilder builder, String itemType, String targetFolder)
at NuGet.CommandLine.ProjectFactory.<>c__DisplayClass56_0.<CreateBuilder>b__1(ProjectFactory p)
at NuGet.CommandLine.ProjectFactory.ApplyAction(Action`1 action)
at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath)
at NuGet.CommandLine.PackCommand.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.BuildPackage(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
System.Exception: Unexpected exit code 1 returned from tool nuget.exe
at Microsoft.TeamFoundation.DistributedTask.Task.Internal.PowerShell.InvokeToolCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
******************************************************************************
Finishing task: NuGetPackager
******************************************************************************
I've done just about everything I can think to troubleshoot this, including cloning the repo fresh to my local machine with the exact same paths (C:\a\1\s
) and including the version of nuget from my machine (v3.4.3) in the repo so that the nuget task can use that specific version. When I run the exact command line from the log locally, it creates the package with no problems.
In the VSTS build it seems to choke on System.Reactive
dependency for some unknown reason. I've even marked that dependency with developmentDependency="true"
to see if that made any difference, but it seems like nuget.exe
is ignoring the packages.config
file entirely.
Below is an image of the task configuration, it's pretty straight-foward: