Iris Classon
Iris Classon - In Love with Code

When NuGet is down

I just did a session at TechDays Finland and although the session went really well I did have some unexpected issues. One hour before my session NuGet.org went down, and I had just cloned my repository for my session- and my session was pretty much code only.

[caption id=“attachment_35883” align=“aligncenter” width=“695”] Picture proof :D Picture proof :D[/caption]

I ended up starting my session by showing how you add your own package source in Visual Studio, and where you can find your local cache from previous downloads.

You will find NuGet packages cached in two places:

C:\Users[user name]\AppData\Local\NuGet\Cache

This cache has all your previously downloaded packages for your user.

nuget-offline7

And

C:\Program Files (x86)\Microsoft SDKs\NuGetPackages

This one has Microsoft specific packages

nuget-offline6

In Visual Studio select Tools, Options, search for NuGet. Add a new package source, give the source a name and set the path. You can also set priority order.
nuget-offline

nuget-offline2

By default Visual Studio now does a restore in the background and picks the source based on the priority order. I forgot to change that, and Visual Studio actually crashed on me probably because it was having problems with NuGet.org. but after reading the error logs I can’t say for certain that it had anything to do with the package source returning 500’s.

When you download packages make sure you select the correct package source, be that if you use the GUI or the console :)

nuget-offline5

nuget-offline4

Comments

Leave a comment below, or by email.


Last modified on 2018-03-22

comments powered by Disqus