Each .NET language has its own complier. when we write a code in C#, C# complier converts it into MSIL. Then JIT converts this code into machine dependent code.
My question is:
IF we write a code in any .NET language, is it managed code?
IF we do not write a code in any .NET language, is it unmanaged code?
What's difference/usage of two?
Binu SubiPosted Mar 30, 2006, 2:29 PM
All .net languages target the CLR(common language runtime), and produces IL (Interndiate Language). This along with the Metadata goes into your PE (portable executable). Now what makes this "Managed Code" is the fact that the .Net Runtime manages the execution of this code. When the code is run, your IL is compiled JIT to native code by a runtime aware compiler. And at this point, the managed execution environment handles your memory management/garbage collection, type safety, overflow/boudary checking, index checking etc.
Unmanaged code (say regular c code) is just a piece of binary code loaded into memory, OS handles memory management to a certain level, but dont have any other control on what your code does and how it does!
Cheers!
Brandon TurnerPosted Mar 30, 2006, 9:36 AM