Where does NuGet put the DLL file?
.NET Core
In .NET Core, NuGet packages are now stored in a global location, by default:
Windows: %userprofile%\.nuget\packages
(aka C:\Users\[User]\.nuget\packages
)
Linux: ~/.nuget/packages
Additionally, the packages.config
was removed with references now being stored using the <PackageReference>
element in the .csproj
file.
You can find out more documentation here.
If you can't find the global location, it may have been changed. You can discover it using this command:
dotnet nuget locals global-packages --list
If you would like to change the package location to, for example, e:\packages
, you can use the following command.
dotnet nuget config -Set globalPackagesFolder=e:\packages
Any problems installing NuGet packages that I've had have always been fixed by clearing all the cache locations (there are additional places where NuGet packages are saved aside from the global location) like so:
dotnet nuget locals all --clear
The short answer is that if you install a NuGet package from Visual Studio (either using PowerShell or the dialog), any assemblies that it contains will be referenced from the Packages folder.
Note that Visual Studio has some quirky behavior such that if you try to build and the packages folder is missing, and the DLL file exists in the 'bin' folder, then it switches the reference to go to the 'bin' folder. Maybe that's what you are seeing?
If that's not the case, and you have a reproducible set of steps that lead to assemblies being referenced not from the Packages folder, please open a bug on http://nuget.codeplex.com/.
This helps me with this issue
Delete the below line in the packages.config file
< package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net45" />
Delete folder "Area" - all the files in it
Install the NuGet package:
Install-Package Microsoft.AspNet.WebApi.HelpPage