- Home /
How to view c# assembly code in Visual Studio 2019?
I just want to see what the assembly code looks like.
Answer by BoraHorzaGobuchul · Mar 08, 2020 at 06:32 AM
@martygrof3708 VS compiles the components of your program to the 'bin' folders in your solution. These compiled components all have the extension 'dll' or 'exe'. These files contain IL (Intermediate Language) code, not machine-specific assembly-code. You can use the Ildasm.exe (IL Disassembler) to view Microsoft intermediate language (MSIL) information in a file. Ildasm.exe is provided by Microsoft: "https://docs.microsoft.com/en-us/dotnet/standard/assembly/view-contents".
Right. Though I would suggest to use ILSpy which can decompile the binary IL code to either IL , C# and even Visual Basic .NET. The produced IL is not 100% compatible with $$anonymous$$SIL but close. However in most cases you're more interested in high level languages.
Note that IL code is intermediate code and not what is actually executed. The IL code is jit compiled by the .NET runtime at execution time. So the actual machine code only exists in memory during execution and depends on the platform.