How does the code written in different languages get executed in .net?
Multiple- Language Support in .Net
The CLR is language-neutral, which means that it can run code written in C#, Visual Basic.NET, Visual C++, Visual J#, Net COBOL, RPG.NET, or any other language, as long as that language is first compiled to the bytestream format the CLR expects. When compiling to managed code, the language-specific compiler translates the source code into Microsoft Intermediate Language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. The compiled MSIL is placed into an EXE or DLL file, called a Portable Executable (PE) file.
Before code can be run, the MSIL in the PE must be converted to CPU-specific code, by a CPU-specific just-in-time (JIT) compiler. Because the Common Language Runtime supplies one or more JIT compilers for each computer-processor instruction architecture it supports, the same set of MSIL can be JIT-compiled and run on any supported architecture for example, Itanium, x64, or x86. During execution, managed code receives services such as garbage collection, security, interoperability with unmanaged code, cross-language debugging support, and enhanced deployment and versioning support from the CLR .