Nuget is one of my favourite tools within the Visual Studio ecosystem, but sometimes you need access to packages you have installed before while you are not connected to the internet. This simple trick shows you haw you can do just that.
NuGet caches all the packages it downloads in a subfolder of your AppData filestore. You can easily set this folder up to be a package source like so…
- Open Visual Studio, and go to Tools -> Options
- Find the “Package Manager” section, and expand it
- Click on “Package Sources”
- Click the “Add” (+) button in the top right
- Set a name for your local cache (I call mine “Cache” – imaginative, huh?)
- Enter the path “C:\Users\<username>\AppData\Local\NuGet\Cache” in the Source textbox
- Press “OK”
Now when you open the package manager, you will see the Cache folder listed as a package source and you can install packages from there. Be aware, though, that packages may be out of date with respect to the online version, and dependency packages may not be available.