zam6ak
zam6ak

Reputation: 7259

Migrating to NuGet Automatic Package Restore

I am migrating MSBuild-Integrated package restore to Automatic Package Restore which became available with v2.7 of NuGet. Steps are easy to follow but I am confused with part that mentions .nuget/NuGet.Config

If I create a new solution with few projects, Automatic Package Restore "just works" and there is no .nuget folder at the solution level at all...

  1. So why does migration doc mention I need to leave it? It works if I remove it...
  2. I read in the docs that one possible advantage of leaving it is that "Using this approach, rather than cloaking the packages folder or otherwise ignoring it, allows NuGet to completely skip the call into Visual Studio to pend changes to the packages folder." Is that it? Is this a big advantage (as opposed to having a cleaner solution)?

NOTE: I am using Git in TFS and not TVSVC.

Upvotes: 3

Views: 683

Answers (1)

nikib3ro
nikib3ro

Reputation: 20606

That NuGet.Config file is only for Team Foundation Server (TFS). If you are not using TFS, then you can safely remove it. To quote Migrating MSBuild-Integrated solutions to use Automatic Package Restore:

By default, the NuGet.Config file instructs NuGet to bypass adding package binaries to source control. Automatic Package Restore will honor this as long as you leave this file in place. Note that NuGet.Config only has an effect when using Visual Studio to integrate with Team Foundation Server (TFS).

Upvotes: 1

Related Questions