How can I view MSIL / CIL generated by C# compiler? Why is it called assembly?

前端 未结 13 1027
南方客
南方客 2020-11-28 18:53

I\'m new to .NET C# programming. I\'m following few books. It is said that instead of compiling it directly to binary code (Native code). High level code is converted into i

13条回答
  •  遥遥无期
    2020-11-28 19:44

    Another option: Use ReSharper

    Source / IL synced view: left blue background line corresponds with right IL Block

    In Visual Studio:

    • Choose ReSharper | Windows | IL Viewer
    • or Context Menu: Navigate | IL Code

    Supports synced view of Source Code and IL - when you click on a statement in source, the corresponding block in IL is highlighted (and vice versa). Displays descriptions for IL from Microsoft Developer Network and "Common Intermediate Language (CIL) instruction set" from ECMA standard specification.

    see Viewing Intermediate Language (IL) in Resharper Help. Picture above is from Resharper Help.

    Free option is to use Jetbrains dotPeek

    see also: "Exploring Intermediate Language (IL) with ReSharper and dotPeek", by Maarten Balliauw, January 19, 2017 - Jetbrains Blog

提交回复
热议问题