56

What is the file packages/repositories.config? Should it be kept under version control?

Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
  • 3
    possible duplicate of [NuGet - repositories.config](http://stackoverflow.com/questions/7286261/nuget-repositories-config) – Kenny Evitt Sep 08 '14 at 16:13

2 Answers2

61

According to Nuget dev David Ebbo

If you use the Package Restore workflow, you can completely omit the Packages folder from source control (including this file).

https://stackoverflow.com/a/7297465/284795

Community
  • 1
  • 1
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
  • 2
    Note to not confuse SolutionFolder/packages/repositories.config with ProjectName/packages.config... While the former can be omitted (per the comment above), I don't think the latter should be? – Funka Jan 25 '13 at 00:29
  • 3
    @Funka they don't even have the same name.. ? – Jake Berger Feb 12 '13 at 17:16
  • 2
    You're right, technically the file names aren't the same but the "packages" folder name is, hence the note. So instead of adding a question mark at the end of my comment, I should have ended instead with "be sure not to confuse these two different things since their names are similar", especially since when in a source control commit dialog they might be easily mistaken for one another. – Funka Feb 12 '13 at 23:50
  • 1
    With NuGet 2.7, a new Automatic Package Restore approach has been introduced. This page also covers 'Using NuGet without committing packages to source control': http://docs.nuget.org/consume/package-restore/msbuild-integrated – Tony O'Hagan Oct 25 '15 at 23:43
13

If you open it in a text editor, you will see it is a list of all of the packages.config files for your solution.

Should it be kept under version control? That depends. NuGet's built in package restore feature will recreate this file because it uses the packages.config file for each project when that project is built. However, TeamCity's package restore feature uses packages/repositories.config.

Why would you use the TeamCity package restore if you have NuGet's package restore enabled? If you have a Silverlight project with NuGet packages, for some reason something goes wrong with the package restore when building with MSBuild. For more details, check my question on the issue. Issue with PackageRestore, Silverlight, and MSBuild

Community
  • 1
  • 1
cadrell0
  • 17,109
  • 5
  • 51
  • 69