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
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
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.
The location of the default global packages folder. The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux).
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.
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.
looks like it installs the packages in %UserProfile%\.nuget\packages\
when packagereference in enabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With