What is the .NET Framework? - Components of .NET
(Page 2 of 6 )
.NET framework has two main components. They are:
Common Language Runtime
.NET class library
Common Language Runtime
The Common Language Runtime (CLR) is the environment where all programs in .NET are run. It provides various services, like memory management and thread management. Programs that run in the CLR need not manage memory, as it is completely taken care of by the CLR. For example, when a program needs a block of memory, CLR provides the block and releases the block when program is done with the block.
All programs targeted to .NET are converted to MSIL (Microsoft Intermediate Language). MSIL is the output of language compilers in .NET (see figure 2). MSIL is then converted to native code by JIT (Just-in Time Compiler) of the CLR and then native code is run by CLR.
As every program is ultimately converted to MSIL in .NET, the choice of language is pure personal. A program written in VB.NET and a program written in C# are both converted to MSIL. Then MSIL is converted to native code and run. So, whether you write program in C# or VB.NET at the end it is MSIL all that you get.
It is believed VB6.0 programmers will migrate to VB.NET and C++ and Java programmers switching to .NET will prefer to use C# as it more resembles those languages.
For Java programmers, MSIL in .NET is same as Bytecode in concept. CLR is same as JVM (Java virtual machine).
So the inevitable question is “Is .NET platform independent like Java?” The answer is technically YES. A program written for .NET can run on any platform as long as .NET is made available on that platform. As of now, .NET runs only on Windows. So, .NET is technically platform independent but not reall, at least not now. Efforts are on to make .NET run on Linux. The project is called as Mono and is currently being developed. Though some people doubt the seriousness of Microsoft, I will not be surprised if Microsoft comes out with .NET on Linux in future. If that happens, all your VB.NET, and C# programs can run as they are on both Windows and Linux. Who knows what more in store?

Figure-2: MSIL and CLR in .NET Framework
The code that is run under CLR is called Managed code.
Next: .NET Class Library >>
More .NET Articles
More By Niranjan Babu Kalla