Reputation: 398
Really weird problem with restoring AutoMapper on the hosted build agent in Team Services (previously VSO). It just fails with a Warning 'Unable to find version 5.1.1 of package AutoMapper'.
We have a custom and private nuget repo so we've had to add a nuget.config to list all the sources but for some reason AutoMapper cannot be found! It works perfectly fine in Visual Studio IDE even after deleting the packages folder.
To test out if it is the custom setting with nuget sources, I've created a build for another solution which happily goes past the restore as there is no reference to AutoMapper there.
I cannot conclude it is AutoMapper because it works from IDE but I cannot say that the nuget.config is a problem either because the second solution works (has a different issue
Upvotes: 5
Views: 1903
Reputation: 1987
There was (or is) a known problem with the nuget v2 feed/api. Which goes away if you use v3. See@ https://github.com/NuGet/Home/issues/1448
It's fixed in later versions of nuget, which might be why upgrading the version fixed it here.
Upvotes: 0
Reputation: 410
In VSO, you can select the Nuget version in the advanced section of the Nuget Installer build step. I just set mine to "3.5.0 - build 1938 (rc2)" and nuget was able to find the AutoMapper package.
Upvotes: 2
Reputation: 398
We got around this problem and here's how:
The problem started when we added nuget config part of the build process as we have our own nuget server as well for packages that are internal.
After trying ExpressMapper and working with it for some components, we found that AutoMapper is a dependent package for some of the packages we use so we had to find a way to use automapper.
we built automapper package version we needed and uploaded it to our own nuget server and that worked. I hope this helps someone.
Upvotes: 0
Reputation: 26785
Sounds like the VSO build agent does not have the latest NuGet client installed. It's this reason that I include nuget.exe in my repository - too many times NuGet client breaks against nuget.org.
Upvotes: 3