Logan G. Logan G. - 3 months ago 17
C# Question

Visual Studio or Resharper extension to decompile code

Does anyone know of a Visual Studio extension that will decompile assemblies and allows you to view code in Visual Studio for a given class instead of having to leave VS and use ILSpy or other "external" reflection tools? I Know Resharper also has a reflection tool but it would be nice if you could kick it off within VS.

Answer

I Know Resharper also has a reflection tool but it would be nice if you could kick it off within VS.

You can. With the cursor on an identifier, choose ReSharper | Navigate | Navigate To... (the keyboard shortcut in the VS scheme is Alt+`), and choose Decompiled Sources.

This uses the same decompilation engine as dotPeek, the standalone tool.

Note that within such a decompiled source, you must continue to use this same navigation method to follow definitions, as F12 or Ctrl+click will go back to the Object Browser.