Aug
29
2011

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 analyze 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 we need to pay money if we can develop open source product like ILSpy? That decompiler tool almost giving same functionalities like .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 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 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 plugin's capabilities.
 
Assembly browser

References:

ILSpy Plugins

Wiki ILSpy

ILSpy Visualizer - plugin for better assemblies vizualization.

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 an excellent decompilation of the source files.  If you are interested in contributing join ILSpy in #sharpdevelop (on freenode). Happy programming... 

DotnetKicks
DotNetShoutout

This blog content RSS subscrption.

Comments (4) -

Tory Burch Outlet


  xiao  yan   Tory Burch Outlet   http://www.toryburch--outlet.net  

TT

i place the assembly visualizer into the ilspy directory, but ilspy doesn't use it.  no additional menu options appear.  am i doing something wrong?

Admin

TT,

You should change assembly file properties to unblock.

Mool

I am using the ILSpy and some of the classes in decompilation is getting bad text.
Like below:
AEDGiftLogic.<>c__DisplayClass1 <>c__DisplayClass = new AEDGiftLogic.<>c__DisplayClass1();
<>c__DisplayClass.giftId = giftId;

And also ldtoken statements which are giving me compiler errors. any help will really appreciated.

Pingbacks and trackbacks (3)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Author - Agafonov Viacheslav

Agafonov Slava site

Hello world! My name is Agafonov Viacheslav. I'm a software engineer at Microsoft located in Bellevue next to Redmond campus and Seattle downtown, state Washington. I was born in Ukraine. My passion for programming is in my ability to create tools that make people's lives easier.

Vyacheslav Agafonov profileAgafonov blog Agafonov Slava on Twitter Counter.com

Month List

Disclaimer

The opinions and information that expressed here do not represent my employer's view in any way. Information in this blog is my own opinion and does not reflect on employer. Content on this site is licensed under a Creative Commons 3.0 license.

Advertise with me!