Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I tell TeamCity's NuGet Installer build step to use both NuGet.org and the TeamCity provided packages source?

I'm having trouble with my NuGet Installer build step.

We're using both official NuGet.org packages and our own packages hosted on the TeamCity NuGet server. If I leave Packages Sources blank, then packages from nuget.org are found, but as soon as I specify %teamcity.nuget.feed.server% as the package source, then packages from nuget.org are not found.

I tried setting Packages Sources to include both, but it still isn't working for official nuget.org packages.

https://nuget.org/api/v2/
%teamcity.nuget.feed.server%

Is that not the right URL for the nuget.org package source? How do I tell it to use both sources?

I asked this on the JetBrains Developer discussion board, but haven't gotten any responses.

like image 710
CoderDennis Avatar asked Oct 15 '12 14:10

CoderDennis


People also ask

What is the default NuGet package source?

The default source is nuget.org, which has the following package source URL: https://api.nuget.org/v3/index.json .

Where are NuGet package sources stored?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).


2 Answers

Had same problem, funny enough my Nuget sources were specified as
https://www.nuget.org/api/v2/
http://nugetserver/nuget
Adding a forward slash on the second url to make it http://mynugetserver/nuget/ fixed the problem. Took me a while to figure out. Now my Nuget-installer build step is running fine.

like image 145
Edmund Avatar answered Oct 21 '22 14:10

Edmund


Apparently the NuGet Installer build step is not even needed. I edited the .nuget/NuGet.targets file to include both paths and removed the NuGet Installer build step and it works now.

When originally setting up TeamCity for this solution, it didn't work without the NuGet Installer step, so I don't know what else I've done differently to make this work, but maybe the NuGet.targets file was the key all along.

The comment on this blog post pointed me in the right direction.

like image 26
CoderDennis Avatar answered Oct 21 '22 13:10

CoderDennis