Search code examples
c#visual-studiocil

View Intermediate Language code in Visual Studio


I want to see the IL code for my C# code in Visual Studio.

The only way I have found to do this, is by the command line tool ildasm.exe, but this tool has a very rudimentary UI.

Here is an example of ildasm.exe showing the IL for a simple console app.

enter image description here

Is there a way to view that within VS 2022? Are there any native windows, that one could bind to a hotkey, to show the IL for C# code? Similar to how you would show a class definition when you press F12 on a class.


Solution

  • As mentioned in the comments, Visual Studio currently does not have a built-in tool for viewing C# IL code.

    But there are some extensions that can view C#'s IL code, such as ReSharper, ILSpy