Steps Involved in transforming the code to MSIL

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
i am new to this group, i would like to know the steps that CLR takes to
convert the code to MSIL.

Thanks
 
Hi,
When you write code in any language and compile, it will be converted to an
'Intermediate Language' (Microsoft Intermediate Language - MSIL). So, your
compiled executable contains the IL and not really executable machine
language. When the .NET application runs, the .NET framework in the target
computer take care of the execution. (To run a .NET application, the target
computer should have .NET framework installed.) The .NET framework converts
the calls to .NET class libraries to the corresponding APIs of the Operating
system.

Whether you write code in C# or VB.NET, you are calling methods in the same
..NET class libraries. The same .NET framework executes the C# and VB.NET
applications. So, there won't be any performance difference based on the
language you write code.

Hope this answers your question.

Thanks and Regards,
Manish Bafna.
MCP and MCTS.
 
Conversion to IL is a simple compilation task performed by one of the
built-in C# of VB compilers. MSIL is effectively a pseudo-instruction
set for a virtual machine. This language describes every logical
operation required to execute a specific algorithm, like assembler, but
this code is never run, even on a "virtual machine"

Instead, the code is compiled to native assembly code just before
execution.

If you're interested in looking at IL I recommend using Reflector
because you can compare between the IL and the various languages that
are compiled to it.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Thanks for the answers. However i would like to know in detail step by step
involved by CLR to convert the code to MSIL.
 
The point you're missing is that the CLR doesn't convert code to MSIL.

The CLR loads, verifies, JIT compiles MSIL and runs native code in a
particular app-domain.

The compilers csc.exe and vbc.exe compile source files to msil.

Reflection.Emit can create assemblies and run them dynamically. This
runs on top of the CLR as does any other application.

Source code in codebehind files is compiled on-demand by the ASP.NET
runtime during server requests. This also runs on top of the CLR as an
application.

Instead of just repeating your incorrect assumption, why not explain
exactly what it is you're unclear about and we'll try to answer in the
right way.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top