49

I'm new to ASP.NET Core, and am trying to figure out where NuGet packages are stored on my local machine.

I've installed the following NuGet packages:

nuget dapper 
nuget MicroOrm.Pocos.SqlGenerator

I want to replace one of the DLL's with my own compiled version, but I don't know where to put it. The Dependencies folder shows nothing.

2 Answers 2

91

For project.json the nuget directory is in the user profile folder (%UserProfile%\.nuget\packages)

UPDATE

From msdn

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. When using the packages.config, packages are installed to the global-packages folder, then copied into the project's packages folder.

When using PackageReference, the globalPackagesFolder configuration value from nuget.config is used. The default value is:

Windows: %userprofile%\.nuget\packages

Mac/Linux: ~/.nuget/packages

When using packages.config, the repositoryPath configuration value from nuget.config is used. The default value is:

$(Solutiondir)/packages

Both locations (globalPackagesFolder and repositoryPath) can be overridden using the NUGET_PACKAGES environment variable. The environment variable takes precedence over the configuration setting.

4
  • 1
    how do you get this location in MSBuild? before you would just do "..\..\packages\ "
    – fkilaiwi
    Commented Feb 17, 2017 at 23:40
  • 2
    well, you could do something like this `$(UserProfile)\.nuget\packages` Commented Feb 19, 2017 at 15:16
  • I cant find project.json file @JuanM.Elosegui Commented Feb 5, 2018 at 7:54
  • 1
    @ErçinDedeoğlu Early versions of .NET Core used project.json files. It was subsequently abandoned. See learn.microsoft.com/en-us/dotnet/core/tools/… Commented Apr 29, 2018 at 2:43
16

According to this documentation you can run this command which will list all Nuget folders on your machine:

dotnet nuget locals all -l

The result will be something like this (folder names self are explanatory):

C:\Users\...>dotnet nuget locals all -l
info : http-cache: C:\Users\...\AppData\Local\NuGet\v3-cache
info : global-packages: C:\Users\...\.nuget\packages\
info : temp: C:\Users\...\AppData\Local\Temp\NuGetScratch
info : plugins-cache: C:\Users\...\AppData\Local\NuGet\plugins-cache

Not the answer you're looking for? Browse other questions tagged or ask your own question.