开发者

NuGet - repositories.config

开发者 https://www.devze.com 2023-04-02 16:20 出处:网络
NuGet newbie que开发者_如何学Cstion- I saw repositories.config being added in NuGet packages folder.

NuGet newbie que开发者_如何学Cstion-

I saw repositories.config being added in NuGet packages folder.

Can anyone please guide me what is the purpose of this file?

Thank you!


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


You need to include the repositories.config file in your source repository if you are following the Automatic Package Restore work flow.

Have a look on http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages where it specifically mentions this point.

0

精彩评论

暂无评论...
验证码 换一张
取 消