How to install packages when NuGet is down

Posted: 17. March 2012 23:33 in Visual Studio | Tools

Sometime during the 9th of March NuGet.org went down. This turned out to last for a while and a lot of people on twitter told their stories how builds were breaking and how they did not get to download packages. For me, I actually noticed have often I use NuGet and how annoying it is not having a backup plan.

If you wonder why NuGet was down, you can read about it on their blog: http://blog.nuget.org/20120314/the-nuget-gallery-outage-on-march-9.html

Thru twitter I soon realized that I could add my NuGet cache as package feed, this was a great way to use all the packages I usually add to my projects. Unfortunately I had not used the package I needed on that computer before, so I was not able to install the package. But nevertheless I will let you know how you add your NuGet cache as a package feed.

It is a pretty easy job to add new feeds to your NuGet package manager console. When you are in the package manager console, click on the “Package Manager Settings” button, marked with red circle in this picture. There is also possible to go on visual studio tools menu and options. Here you find a “Package Manager” node witch is the same place this button goes to or you can go on the tools menu – Library Package Manager – Package Manager Settings.

Package Manager Console

On the Package Manager Settings page, go to the Package Sources node. Her you see the feeds available to use thru NuGet. Now I am adding a new feed called Local NuGet Cache, and in the source I use C:\Users\<LoggedOnUser>\AppData\Local\NuGet\Cache which points to my NuGet cache.

Package manager settings

Now I have this Local NuGet Cache that I created as a option in my Package Manager Console and can use it just as I would use the official NuGet feed.

Package manager console list of feeds

So my backup strategy now is that I put my Local NuGet Cache and my public MyGet feed as alternative feeds in Visual Studio. So if NuGet will go down again for any reason I have some chances to get my most used packages still. If it is a package I have used on that particular computer before, it will be in my local NuGet cache. If it is not a package I have used before, hopefully I have added it to my MyGet feed so it is still available to me.

If you wonder what www.myget.org is, it is a site where you can create your own NuGet feed with packages from NuGet or any other package you might have. It is easy to use, works great and it is free if you choose the public or community feed, private feeds are not free.

dotPeek–Free .Net decompiler

Posted: 19. August 2011 22:23 in .Net | Tools

Overview of dotPeekEver wondered what the .Net framework looked like or had the need to look into someone else's code? Then dotPeek from Jetbrains is the thing for you.

dotPeek decompiles any .Net assembly, from the old 1.0 to 4.0. The decompiled assembly is categorized in namespaces and all the code is shown in C#. You can browse your hard drives for assemblies to look at or have a look at those in the GAC.

Easy navigating, familiar shortcut keys and syntax highlighting that all remind you of Visual Studio.

There are others decompilers for .Net as well, IL Disassembler comes with the .Net SDK, but it only show you the IL code as the name suggests. Another one and probably the most known decompiler is .Net Reflector from Redgate. Its not free, but the professional editions come with Visual Studio integration, possibility to debug assemblies you don’t even have the source code too and much more. There is also a bunch of other decompilers out there, but I don’t have any experience with any other then the three that I have mentioned.

For me it is not very often I have the use for a decompiler, but when there is a situation you need too look into an assembly you don’t have the source code too, they are great. I had one of those moments this week and dotPeek came along and saved the day. Thank you =)

Jetbrains – dotPeek
Redgate - Reflector