Web Design that taps into the haromny and vision of your dreams.

Common Language Runtime

A look behind the scenes at the Common Language Runtime

Written By on in C#

249 words, estimated reading time 2 minutes.

The Common Language Runtime simplifies application development, provides a managed execution environment, supports all .Net languages, and simplifies application deployment and management.

Introduction to the .Net Framework Series
  1. What is Microsoft .Net?
  2. Benefits of using the .Net Framework
  3. Languages in the .Net Framework
  4. The C# vs Visual Basic Question
  5. Common Language Runtime
  6. The .Net Common Language Specifications
  7. Global Assembly Cache (GAC)

The Common Language Runtime (CLR) is where the Microsoft Intermediate Language code is compiled to machine code (or native code) and executed. It is the CLR on the target platform that compiles the code, which allows portability between devices. This concept may become clearer in the following diagram.

The .Net Platform and Code Distribution
The .Net Platform and Code Distribution

Any code you write on your machine, either in Visual Studio or another development tool, is compiled into Microsoft Intermediate Language (MSIL), which is a half way intermediate machine code. It has been compiled, but not into machine code (which is the code run by a processor). This MSIL code is then distributed to any hardware platform that supports the .Net framework, either a web server, Windows 98, Windows 2003 Server, a hand-held device and so on...

When the MSIL code is invoked, it is loaded into the CLR where it is managed by the platform and further compiled to machine code so that it may be run on the processor.

The CLR provides a managed environment where the system performs memory management, security, debugging, type checking, thread support and much more.

In most programming languages it is the responsibility of the programmer to manage memory and resources, however in .Net, the Garbage Collector will automatically clean up the objects once all references to them have been removed. This overcomes the problem of memory leaks, which were a big problem in languages such as C++. The programmer is still responsible for managing database connections and file handles.

Last updated on: Friday 23rd June 2017


Ramon Li

Ramon Li

Visual C++ can create non-CLR applications (ie, unmanaged). When you create a project just select an application type where the name starts with MFC, ATL, or Win32 and you'll be creating an non-CLR type application.

Reply to Ramon Li



can i create a VC++ application that does not run on a .net environment?

Reply to varsha


Leave a Reply

Your email address will not be published.

If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

Copyright © 2001-2018 Tim Trott, all rights reserved. Web Design by Azulia Designs

This web page is licensed for your personal, private, non-commercial use only.

Disclaimer, Privacy & LegalSitemapContact Me