TransWikia.com

Free tool for exploring compiled .NET assembles, alternative to .NET Reflector?

Software Recommendations Asked by Ivaylo Slavov on September 25, 2021

Would you recommend a free tool for exploring compiled .NET assemblies. I need to be able to:

  • Explore the assemblies’ source code and visualize the IL to a CLR language of choice (C#, VB.NET, managed C++ and etc.)
  • Support navigation between the classes (via Ctrl + click on the class name for example, or other convenient way).
  • Allow examining the embedded resources in the assembly, if any (text, images etc.)
  • Capable of handling assemblies since .NET version 2.0.

Optionally, I will be glad if it supports:

  • Exporting classes to source files.
  • Integration with Visual Studio 2010 (this one need not be free) that allows for debugging the source code.
  • Integration with the Xamarin Studio IDE (former MonoDevelop) would be a plus, although I am getting too optimistic here.

I used to work with .NET Reflector a few years ago and it supported most of the above features (actually all except the Xamarin integration). I tried to use it again a few weeks ago but now it has become a commercial product and my old free version does not work anymore.

4 Answers

ILSpy is one of the more popular FOSS .NET decompilers. It's pretty intuitive to use, though I have not yet tried Reflector so I can't compare them.

Unfortunately, it doesn't completely satisfy your requirements, though it gets close. There is no support for decompiling to C++/CLI, though it does work well for IL, C# and VB.NET.

You can click on class and method names to navigate to their definitions, or analyse them through the context menu for where they are accessed. It can render both images and text from embedded resources, and allows you to save them - I have not tried other filetypes, but they should work in the same way.

You can export classes to source files, and you can even export entire assemblies into .csproj (MS build) files. For simpler projects these can be compiled directly. Many more complex projects tend to fail to compile without modification - notably, their site mentions it can't decompile and then recompile itself. If you need to decompile an entire assembly, you would likely have a lot of work left to get it to a compilable state.

Unfortunately, decompilation is not perfect. Some more complex language constructs, like C#'s dynamic, are not yet supported and can result in somewhat garbled output. You can still get the general algorithm through the clutter, but it certainly wouldn't work if you just wanted to copy some code.

IDE integration. There was an early attempt for Visual Studio, though it appears to have been abandoned. There also doesn't seem to be any integration for Xamarin (when'd that happen?). However, the developers of ILSpy also created SharpDevelop, and recent news indicates they are planning SharpDevelop integration.


If you want other options, there's also dotPeek and JustDecompile. They do claim to have Visual Studio extensions, and might be more polished with some well-known companies behind them. I have not had a need to use either of them (ILSpy has worked for everything I needed), but they may suit your requirements better.

Correct answer by Bob on September 25, 2021

The answers here are good for the time the question has been asked. In the meanwhile, IMHO, dnSpy has outperformed them.

  • ✓ Visualize as C# or VB.NET - or IL
  • ✓ Navigation between classes - by Ctrl+Click
  • ✓ Examination of resources - live preview
  • ? Handling .NET since 2.0 - I could not find such an old program for testing :-)
  • ✓ Exporting classes to source files - only the whole project. I could not find it for single classes

It also has other useful features:

  • edit the code directly
  • syntax highlighting
  • debug

I have used dotPeek before, but replaced that by dnSpy 2 years ago and I'm happy.

Answered by Thomas Weller on September 25, 2021

I personally am a big fan of dotPeek from Jetbrains as it ties in very nicely with Resharper and has some additional features to pull in .pdb:

enter image description here

Answered by ppittle on September 25, 2021

There is another tool developed by telerik - JustDecompile. It works really well, and has all the features of .NET Reflector and then some. (Including a visual studio extension). It's also free, which is nice. I've used it every since it came out and its quite nice.

One of my favorite features, is located under the tools menu "Create Project", it takes the assembly and build a csproj file out of it.

Just Decompile With Mysql data provider

Answered by user23 on September 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP