Version Control – Should the NuGet PACKAGE Folder Be Included

cgitvb.netversion control

In a C# or VB.NET project, should we include the PACKAGE folder (NuGet package folder that is created in the root of my project that contains the nupkg files and other content) to our source control repository (Git for instance)?

Best Answer

A lot of time has passed, and NuGet has changed, so here's a new answer.

NuGet no longer creates a packages folder inside your source structure. Instead there is one in your user directory (%USERPROFILE%\.nuget\packages on Windows, to be specific) where it puts all packages it downloads, and projects just reference these.

So the simple answer these days is no, you shouldn't. If you are worried about packages you need disappearing, you should create a local NuGet mirror that you back up separately.

Related Topic