dotPeek 2024.2 Help

View intermediate language (IL)

dotPeek allows you to study decompiled symbols as intermediate language (IL) or as C# with different levels of syntax sugar.

IL Viewer

When you open symbols from compiled assemblies, you can always study them in the intermediate language independently of their presentation in the code viewer. Even if the symbol is displayed in the original source file obtained through PDB, dotPeek will find the related piece of IL code for it.

View intermediate language (IL) for a symbol

  1. Do one of the following:

    • Right-click anywhere in the code viewer and choose Navigate | IL Code

    • Invoke Navigate To Control+Shift+G and choose IL Code.

    • Right-click a symbol in the code viewer and select IL Code.

  2. dotPeek will display the IL code corresponding to the symbol in the IL Viewer window.

  3. While the IL Viewer window is open, the view is synchronized with the caret position in the code viewer and the matching code is highlighted. To change that, click Track Caret in Editor Track Caret in Editor on the toolbar of the IL Viewer.

dotPeek: Using IL Viewer

In the IL Viewer window, if IL presentation is selected, you can learn descriptions of IL instructions in tooltips when hovering over an instruction. The descriptions are taken from Microsoft Learn and from the ECMA-335 standard (Partition III: CIL Instruction Set).

Details of IL instruction in a tooltip

When you place the caret at a code symbol or instruction, all usages of this item are highlighted. Loops in your code can be distinguished by corresponding indents and comments.

If metadata tokens are enabled, they also appear in the IL code.

View IL code as comments in decompiled code

For decompiled files, dotPeek can also include IL code right in the decompiled document as comments for the corresponding symbols (you can recognize decompiled files by the // Decompiled with JetBrains decompiler comment in the first line).

By default, comments with IL code are disabled. To enable them, tick the corresponding checkbox on the Decompiler page of dotPeek options.

Viewing IL code as comments in decompiled code

Note that as a result of navigation or search, you can get original source code fetched from local or remote location using PDB files and symbol servers, where no additional comments will be included. For more information about different ways of viewing code, refer to Presentation options for compiled code.

Last modified: 23 September 2024