DDC
DDC

Reputation: 862

Where is the MSIL file after compilation of a C# program in .Net?

I am a Java programmer. I am wondering why CSC is generating an exe file instead of generating some MSIL file as Java does (.class files). Is it that .exe is just an extension and the file is actually in MSIL?

Upvotes: 4

Views: 1653

Answers (2)

Lzh
Lzh

Reputation: 3635

.NET assemblies correspond to .class files that contain byte code. .NET assemblies are the files that result from compiling a .NET program so a .exe file or a .dll file are both called assemblies.

PE format is also used for native applications: you can read more about it on the web, here's a link for a start: An In-Depth Look into the Win32 Portable Executable File Format

A .NET assembly not only does it contain MSIL (which is now called Common Intermediate Language CIL) but it also contain resources and meta data. Finally, you can use the ildasm.exe tool to get the disassemble an assembly into intermediate language. It comes with your Visual Studio installation.

Upvotes: 4

Rich O'Kelly
Rich O'Kelly

Reputation: 41767

Is it that .exe is just an extension and the file is actually in MSIL?

Yes.

Microsoft has a disassembler (Ildasm), that will show you the IL and a disassembled version of the file.

Upvotes: 5

Related Questions