当您在LINQPad中查看IL代码时,您会得到以下内容:
IL_0000: nop
IL_0001: ret
Program.Main:
IL_0000: nop
IL_0001: ldstr "Hello World"
IL_0006: call System.Console.WriteLine
IL_000B: nop
IL_000C: ret
Program..ctor:
IL_0000: ldarg.0
IL_0001: call System.Object..ctor
IL_0006: nop
IL_0007: ret
这是一个"清理"视图省略了一些方法/类签名,您可以使用其他工具(Ildasm,Reflector等)查看:
.class public auto ansi beforefieldinit Program extends [mscorlib] System.Object
{
.method public hidebysig static void Main() cil managed
{
//
.maxstack 8
IL_0000: nop
IL_0001: ldstr "Hello World"
IL_0006: call void [mscorlib]System.Console::WriteLine(string)
IL_000b: nop
IL_000c: ret
} // end of method Program::Main
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed
{
//
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib] System.Object::.ctor()
IL_0006: ret
} // end of method Program::.ctor
} // end of class Program
有没有办法在LINQPad中查看这个更广泛的IL代码?