Why isn't there any packages folder in my .NET Core solution's containing folder?

Nuget.Net CoreNuget Package-Restore

Nuget Problem Overview


Are packages now cached in a more shared location somewhere or what?

My solution folder is devoid of any packages folder:

Solution folder without packages folder

Nuget Solutions


Solution 1 - Nuget

Per project: References->Nuget dictates what packages are referenced and restored. But, as Eastrall mentioned, the packages folder is now global and located in your user folder: C:\Users\[YourUsername]\.nuget\packages

Solution 2 - Nuget

To force ./packages folder for Solution

To force download of packages folder to be a child of the solution folder for .NET Core projects, follow these steps:

  1. Create a NuGet.Config file in the same directory as the .sln file.

  2. Copy the following contents into the NuGet.Config file:

> > > > > >

  1. Configure NuGet to download missing packages by:

3.1. In Visual Studio: Tools -> Options

3.2. Filter by nuget (top left in dialog). Select General

3.3. Ensure Allow NuGet to download missing packages is checked

enter image description here

  1. Close and re-open the solution. NuGet will download the required packages.

Note: the NuGet.Config configuration can also be achieved by executing the following command from the NuGet Package Manager Console (Tools -> NuGet Package Manager -> Package Manager Console):

PM> nuget config -set globalPackagesFolder=.\packages -configfile "$(pwd)\NuGet.Config"

Solution 3 - Nuget

You still have packages folder in your .NET Core solution, but the global packages are located at: C:\Users\[YourUsername]\.nuget\packages

Solution 4 - Nuget

You can check out a question I asked to see if the answers do you any good.

https://stackoverflow.com/questions/43687058/how-do-i-include-nuget-packages-in-my-solution-for-net-core-projects

You can get that packages folder back, but you might not be happy with the results, since .Net Core projects rely on so many NuGet packages. Mine is hovering around 1 GB.

https://docs.microsoft.com/en-us/nuget/schema/nuget-config-file#config-section

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionProfKView Question on Stackoverflow
Solution 1 - NugetMSCView Answer on Stackoverflow
Solution 2 - NugetCJBSView Answer on Stackoverflow
Solution 3 - NugetEastrallView Answer on Stackoverflow
Solution 4 - NugetEricView Answer on Stackoverflow