shanselman / ama

Ask me anything
88 stars 5 forks source link

NuGet.config - Centralizing for 50+ solutions? #119

Open trycatchdonothing opened 6 years ago

trycatchdonothing commented 6 years ago

I have 50+ solutions that all have Nuget package references using a private feed/repo. On my local machine, it's a piece of cake to edit the %APPDATA%\Nuget\Nuget.config and have all the solutions build successfully.

Is there a way I can centralize the Nuget.Config on the build server for all these solutions, considering I don't have access to %APPDATA%\Nuget\Nuget.config on the build server?

I tried adding a Nuget.config to my TFS project root (one level above all these solutions), but not sure how each solution can find the file.

Thanks

jnm2 commented 6 years ago

I tried adding a Nuget.config to my TFS project root (one level above all these solutions), but not sure how each solution can find the file.

That'll work so long as each build definition maps that file to the correct place above the solution it's building.

I recommend checking in a nuget.config at the root of each project though, not collection, and mapping the entire project when doing a build. It's simple and modular. It keeps the projects from being coupled to their current file structure surroundings, making it easier if (say) you want to move one project to Git.

It's only a matter of time until you need to customize the config further and then the question is- which project or projects needed that change? Not so obvious if you have a global config file to put things in.

Disclaimer: not @shanselman.