Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where does Nuget download packages when PackageReference is enabled

In visual studio 2017 i have enabled PackageReference so that package reference will be stored in csproj file instead of package.config file

I have added these 2 line in csproj file to enable PackageRefernce

<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

Now when i install any package using Nuget Package Manager, i see something like this

enter image description here

references with blue icon are added as package.

However i dont see any of these packages in packages folder under solution directory. Moreover, if i right click on blue icon (i.e reference) and click on properties, the window the blank. I cannot see the path where its referencing from

So when does Visual Studio download the packages when package? reference is enabled

like image 836
LP13 Avatar asked Feb 12 '18 20:02

LP13


People also ask

Where do NuGet packages get downloaded to?

The global-packages folder is where NuGet installs any downloaded package. Each package is fully expanded into a subfolder that matches the package identifier and version number. Projects using the PackageReference format always use packages directly from this folder.

Where are NuGet package sources stored?

The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).

Where does Visual Studio install NuGet packages?

Visual Studio installs the package and its dependencies in the project. When installation is complete, the added packages appear on the Installed tab. You can also find packages in the Dependencies > Packages node of your project in Solution Explorer.

Where are NuGet packages cached?

Well, remember that NuGet caches the packages it downloads on your local hard drive. My cache was located at C:\Users\scottha\AppData\Local\NuGet\Cache. You can add that cache folder as a NuGet Source by going to Options | Package Manager | Package Sources. You can see I added it in my dialog below.


1 Answers

looks like it installs the packages in %UserProfile%\.nuget\packages\

when packagereference in enabled

like image 50
LP13 Avatar answered Oct 30 '22 03:10

LP13