Okay this might sound a duplicated question, but regarding my searches it is not.
I have been looking for a proper way to configure a specific nuget package source (url) in my solution that automatically generate everything (.nuget folder and/or nuget configuration files) contrained to the solution path.
I don't want to use APPDATA neither MACHINE.
I want to use only the solution directory for everything, so when another user from the repository fetches the solution it get's everything properly installed (including the nuget references on package folder).
I have been reading NuGet documentation and it seems, the way this can be achieved is not straightforward, because of NuGet different versions and so on...
Can someone provide a minimalistic guide to achieve this purpose? Thank you for your help in advance!
Updated Question:
I notice that with NuGet Version 3.4+ I don't need the .nuget folder anymore!
My question/problem is configuring the package source url by solution and not by machine/appdata, this is because I am using a private package source url containing a feed of corporate libraries! thanks :)
Details:
I notice that the Package Sources URL are being stored in the NuGet.config file at %APPDATA%\NuGet\NuGet.Config.
How can I properly configure this by solution? so it easly maintained in a corporate business?
(I mean I don't need each user to configure the source on their machine)
"A solution-specific NuGet.Config file located within a .nuget folder in the solution. Settings in this file apply only to solution-wide packages and is supported only in NuGet 3.3 and earlier. It is ignored for NuGet 3.4 and later."
Does that mean I can't properly configure sources for each solution separately? Thanks!
Okay so here are the steps to configure it by solution (tested and applied to NuGet 3.4.4):
Create/Open your solution.
If it's first time and you never configured your private nuget package source you should go in your VS2015 into Tools > NuGet Package Manager > Package Manager Settings
Then you will notice that the package source will still be there, even if you deleted it from the AppData Folder! (Just make sure your restart your visual studio)
NOTE: If you keep the NuGet.Config file in your AppData the VS itself will concatenate the contents of the config file in AppData and the ones in your solution folder!
NOTE2: Now you just need to check-in into your Git Repository/TFS the file configuration file specified in solution folder and that's it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With