russia is waging a genocidal war in Ukraine. Please help Ukraine defend itself before russia has a chance to invade other countries.
Exploring the Intersection of Software Development, AI Innovation, and Entrepreneurial Success | ILSpy versus .NET Reflector

ILSpy versus .NET Reflector

ILSpy - open source.NET assembly browser, decompiler and software utility for Microsoft .NET combining class browsing, static analysis, and decompilation. Tool for code internal assemblies code analyzes or reflector tool for our applications to improve the performance or to know the internals of the assembly we have created. I was using Red Gate .NET Reflector earlier for same as it was free and with frequent updates. Now Red Gate has made that tool paid (about 35$) version so I found alternative tools from that I can see IL and C# code easily for free. Why do we need to pay money if we can develop an open source product like ILSpy? That decompiler tool almost giving the same functionalities as .NET Reflector.

The new ILSpy GUI is written in WPF and reuses a few SharpDevelop components - the tree view is SharpTreeView, written by Ivan Shumilin for the SharpDevelop WPF Designer outline view. 

ILSpy versus .NET Reflector

 IL Spy Features list

  1. Assembly browsing
  2. IL Disassembly
  3. Decompilation to C#.
  4. Supports lambdas and 'yield return'
  5. Shows XML documentation
  6. Saving of resources
  7. Search for types/methods/properties (substring)
  8. Hyperlink-based type/method/property navigation
  9. Base/Derived types of navigation
  10. Navigation history
  11. BAML to XAML decompiler
  12. Save Assembly as C# Project
  13. Find usage of field/method
  14. Extensible via plugins (MEF)

ILSpy doesn’t have the same plugin system and some of the reflected code looks still has a lot of IL looking code in it (goto statements, etc.), but for such a new tool, it works tremendously!!! For example, in next screenshot, we can see how yield operator was parsed.

 ILSpy versus .NET Reflector

Event it’s provide IL and C# mode also so you can see what’s going on internally on top its having button like this:

.NET Reflector and ILSpy

My friend Denis Markelov developed cool plugin for IL Spy for free ILSpy Visualizer. All found issues, new feature requests or desired changes to the existing features you can share either through a project's GitHub page, or via an e-maildenis@denismarkelov.com
 
 
 
Graph View ILSpy
 
To use a plugin, download the build and put the assembly into the folder where ILSpy.exe is located. After that context menu for assemblies in the ILSpy tree will contain new item - Browse AssemblyCurrently, it contains one component, called Assembly Browser. Its intention is to show type hierarchies in a convenient for the viewer way. Screenshots below will give you an idea of the plugin's capabilities.
 
Assembly browser

References:

ILSpy Plugins

Wiki ILSpy

ILSpy Visualizer - a plugin for better assemblies visualization.

Summary:

I may not use .NET Reflector every day but I use it enough to miss it.  Probably enough to pay for it, but I won’t be supporting RedGate! Of course free is better. As you can see ILSpy easily reflects .NET code giving you excellent decompilation of the source files.  If you are interested in contributing join ILSpy in #sharpdevelop (on Freenode). Happy programming... 

Comments are closed