NuGet newbie question-
I saw repositories.config
being added in NuGet packages folder.
Can anyone please guide me what is the purpose of this file?
Thank you!
If you right click the project in question you can select "Manage nuGet Packages" from the menu. After you do that you can click "installed packages" on the left hand side to see the packages that you currently have installed. These are what you are seeing in your "packages. config" file.
NuGet provides the central nuget.org repository with support for private hosting. NuGet provides the tools developers need for creating, publishing, and consuming packages.
By default, pkg-config looks in the directory prefix/lib/pkgconfig for these files; it will also look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.
It's a file that's mostly a NuGet implementation detail, and should not be dealt with directly (it may go away or change in the future).
But for reference, it contains a list of paths that point to all the packages.config in the solution. Typically there is one per project that uses NuGet.
David Ebbo's answer is from 2011, and the official advice keeps changing between versions.
Here's where we stand in 2015, for NuGet 2.7+ with the 'Automatic Package Restore' (recommended) workflow
I'm paraphrasing, but basically the advice is:
Remove
packages/repositories.config
from source control. We'll re-generate it anyway....unless it somehow breaks on your machine. Then do add it to source control.
This hint comes from the section on ignoring files in git:
# Ignore NuGet Packages *.nupkg # Ignore the packages folder **/packages/*
And the important part:
[...]
# Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config
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