Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tool to select some code in Visual Studio and have it show the corresponding MSIL?

Lately I've found myself constantly running ILDASM to study the MSIL output of my programs.

Are there any utilities to streamline this? Ideally, it would be nice to select some source code and have it compile, disassemble and emit the selected C# code in MSIL.

Anyone know of such a thing?

like image 306
mmcdole Avatar asked Jan 20 '09 00:01

mmcdole


People also ask

How do I find the specific code in Visual Studio?

Visual Studio 17.2 Preview 3 introduces a brand-new All-In-One search experience that merges the existing VS Search (Ctrl + Q) and Go To (Ctrl + T) to allow you to search both your code and Visual Studio features quicker and easier than ever, all in the same place.

Does Visual Studio have a decompiler?

Decompilation is only available in Visual Studio 2019 16.5 and later.

What is CodeLens in Visual Studio?

With Microsoft Visual Studio 2019 version 16.1, P4VS supports the CodeLens feature. With the relevant CodeLens option enabled (which is the default), you can view the names of users who made changes to classes, functions, and methods throughout the code and get a preview of up to five changelists.


3 Answers

.NET Reflector

I think that RedGate have bought the IP to this tool now. I'm fairly sure that there is a VS plugin which integrates to it to allow you to run this from vs.

.Net Reflector Plugin alt text
(source: mutantdesign.co.uk)

like image 155
Spence Avatar answered Oct 26 '22 15:10

Spence


You could use testdriven.net an awesome unit testing plugin that gives you the ability to right click on any member and view it in reflector.

like image 40
Sam Saffron Avatar answered Oct 26 '22 17:10

Sam Saffron


Open the .dll in reflector, select any function in any class, and select IL as the language to decompile to. I don't think you're looking for a level more granular than that.

like image 21
DavidN Avatar answered Oct 26 '22 16:10

DavidN