Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see MSIL code

Tags:

c#

clr

I tried googling and searching StackOverFlow, but I'm not seeing an clear answer to this. How can I see the IL code that my C# gets compiled into? I want to compare two methods to see if they produce the same IL. I saw a really great video once of this guy looking at the IL code, but I forget what tools he used to look at it. I seem to remember the one had a tree-view where he could look around at the different objects in memory. I know he wasn't using Visual Studio.

like image 566
Simon The Cat Avatar asked Dec 13 '25 13:12

Simon The Cat


1 Answers

You can use ILDASM (Intermediate language disassembler).

Other tools like .NET Reflector, dotPeek, JustDecompile or ILSpy can also show the IL code, in addition to showing it in C#, Visual Basic .NET and/or other languages.

LINQPad can also show the IL of your code snippets, but not the IL of arbitrary assemblies.


EDIT: actually dotPeek only shows C# code, not IL

like image 83
Thomas Levesque Avatar answered Dec 16 '25 03:12

Thomas Levesque



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!