2
votes

With NuGet 3.3.0 we get the following error when restoring AutoMapper 5.1.1. Other packages restore successfully:

[11:49:53]  [restore] Unable to find version '5.1.1' of package 'AutoMapper'.
[11:49:53]  [restore] Process exited with code 1

There was an issue we had where we were unable to restore this package in Visual Studio 2013 on our dev machines unless we updated the NuGet package manager.

If we build the project in Visual Studio 2013 on the TeamCity server, the package restores successfully, leading us to believe that it's the NuGet version on the build agents that needs updating.

We tried to upload the NuGet.CommandLine.3.4.3.nupkg via the TeamCity | Tools menu, however TeamCity complains that it's not a valid NuGet package because it doesn't contain tools\NuGet.exe, even though it does!

We did manage to successfully upload Nuget.CommandLine.3.6.0-beta1.1839.nupkg, however that gives us a different error when the build step attempts to run.

So we're stuck. Has anyone out there had this issue and managed to resolve it?

1
If you updated from NuGet v2 to NuGet v3 then I would guess that there are no package sources defined in the global NuGet.Config file %AppData%\NuGet\NuGet.Config. NuGet v3 by default defines no NuGet package sources if the global NuGet.Config file does not exist. NuGet v2 will add nuget.org by default if there are no package sources defined. You can either define one globally or define it in Team City or add your own NuGet.Config file into your repository. - Matt Ward
@MattWard We've been using 3.3.0 successfully for a while. The sources are listed further down in the NuGet build step on TeamCity - all the other packages restore successfully except for AutoMapper. - Tom
Yeah so it sounds like something else. - Matt Ward
Managed to resolve the issue by using NuGet.CommandLine 3.5.0-beta-final. Not ideal using a beta version however I'll try to hunt down a full release version that works with TeamCity. - Tom

1 Answers

1
votes

Uploading NuGet.CommandLine.3.5.0-beta-final.nupkg to TeamCity (Administration => Tools => NuGet.exe => Add Version) and setting the NuGet build step to version 3.5.0-beta-final successfully resolved our issue.

I got the package from: https://dotnet.myget.org/feed/nuget-build/package/nuget/NuGet.CommandLine/3.5.0-beta-final