简体   繁体   English

我怎样才能看到MSIL代码

[英]How can I see MSIL code

I tried googling and searching StackOverFlow, but I'm not seeing an clear answer to this. 我尝试使用谷歌搜索和搜索StackOverFlow,但我没有看到明确的答案。 How can I see the IL code that my C# gets compiled into? 如何查看我的C#编译成的IL代码? I want to compare two methods to see if they produce the same IL. 我想比较两种方法,看看它们是否产生相同的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. 我看过这个看过IL代码的人的视频真的非常精彩,但是我忘记了他用来看它的工具。 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. 我知道他没有使用Visual Studio。

You can use ILDASM (Intermediate language disassembler). 您可以使用ILDASM (中级语言反汇编程序)。

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. 除了在C#,Visual Basic .NET和/或其他语言中显示IL代码之外,其他工具(如.NET Reflector dotPeek JustDecompileILSpy)也可以显示IL代码。

LINQPad can also show the IL of your code snippets, but not the IL of arbitrary assemblies. LINQPad还可以显示代码片段的IL,但不显示任意程序集的IL。


EDIT: actually dotPeek only shows C# code, not IL 编辑:实际上dotPeek只显示C#代码,而不是IL

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM