C# tutorials

Updated : Sep 30, 2020 in Articles

Components of .Net Framework

 1. CLR 🙁 common language runtime)

In this article we will learn about what are the Components of .Net Framework

In .NET framework under the CLR we have the given below components

  • CLI (common language Infrastructure).
  • CLS (common language specification).
  • CTS (Common type system).
  • GC (garbage collector).
  • JIT (just in time).

2. BCL 🙁 base class library) or FCL (Framework class library)

What is CLS 🙁 Common language specification):

When we write the code in any programming language use follow some syntactical rules. These syntactical rules that are followed to write the code in any plus that are known as “language specification”.

  • We know that .Net supports 63 plus
  • Among these 63 plus every programming language bases its own language specification or Syntactical rules.
  • If a consider two programming languages like c#, vb we write the code for if else like.
C#                            vb
If (condition)          if condition then
{                                Statements
Set of                     else
Statements;                statements        
}                                   …
Else                           end if.
{
Statements;
}

Among these 63 plus through every programming languages has its own programming language syntactical rules .one programming language cannot understand other programming languages specification or syntactical rules.

But all these programming language codes are commonly run by the CLR .This is because CLR doesn’t know or can’t understand any of the 63 plus language specification or syntactical rules rather CLR its own language specification of MSIL.

All programming language compiler will generate MSIL from there source code for following the language specification of CLR from MSIL. So CLR understanding MSIL.

This language specification of CLR from MSIL is common for all the 63 plus supported by document so this is known as “common language Specification”.

CLS is responsible to provide language Interoperability.

What is Managed Code and Unmanaged code?

Definition of Language Interoperability:

Providing code execution support that has been written in other programming languages is known as “Language Interoperability”.

In .Net language interoperability achieved in 2 ways

  • Managed code 
  • Unmanaged code.

1. Managed code

Code for which MSIL form is available after the language compiler compilation is directly run by the CLR .This is known as “Managed code”.

For managed code CLR provides all the features and facilities like

1. Language interoperability

2. Common type system (CTS)

3. Automatic memory management

4. JIT compilation

5. Code access security

6. Exception handling mechanism etc.

In simple to say for managed code for CLR managed everything.

Ex: 63 plus code supported by .net.

2. Unmanaged code:

Code which is developed before .net for which MSIL form is not available is not executed by the CLR directly rather CLR is redirect to operating system and operating system will run the code and will give result to CLR .This is known as unmanaged code.

For managed code CLR doesn’t provide any facilities /features of .Net.

In simple terms to say CLR will not manage anything for unmanaged code

Ex: 1.com components

      2. Win 32 API

Always managed code execution is faster, unmanaged code execution is slow.

What is CTS (Common Type System):

We know that .net supports 63 plus in managed code execution among this 63 plus every programming language as its own data type system.

If we consider C# & Vb plus we create an integer variable like

C#:                           Vb

Int a;                    dim a as integer

Through every plus has its own data type system .one plus can’t understand other programming language data types.

But plus data type are commonly run by the CLR .This is because CLR doesn’t form or can’t understand any of the 63 plus data types. Rather CLR has its own data type system for MSIL.

All the plus data type is converted into CLR’s data type by the language compiler.

Here c# compiler will compile its int type to int32 of CLR similarly vb compiler also will compile its integer to int32 of CLR. So CLR is understanding its own data type system i.e. int 32.

This data type system of CLR is common for all the 63 plus supported by document so that is divided into 2 catagerious.

This CTS of CLR is divided into 2 catagerious.

1. Value type.  2. Refrence type.

1. Boxing.          2. unboxing. ​

Latest posts by DuttaluruVijayakumar (see all)
Like
Like Love Haha Wow Sad Angry

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x