What is dotnet Framework ? - .Net Interview questions and answers

"what is dotnet framework ?" I thinks this is first question always asked by all interviewers. You will find too many answers from different blog and tech communities. In this article we shared short and easily to remember answer.

What is dotnet framework ?

According to Wikipedia,
.NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large library and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for .NET Framework execute in a software environment known as the Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. The class library and the CLR together constitute .NET Framework.
In simple way .NET Framework is plateform created by Microsoft to support different type of application development. There are few most important concept you must keep in mind - MSIL, CLR, CTS, CIL, managed code and JIT.

(what is IL or CIL?, what is JIT?)
Microsoft Intermediate Language is also known as Common Intermediate Language. All .NET source code is compied to IL. IL then converted to machine code at the point where software is installed.

Once source code is compiled to CIL, job will transfer to JIT (Just in Time). JIT compiler is part of the runtime execution environment. It will convert CIL code to native code only part of code needed by the program. There are three type of JIT.
  1. Pre-JIT: Pre-JIT compiles complete source code into native code in a single compliation cycle. This is         done at the time of deployment of the application.
  2. Econo-JIT: Econo-JIT compiles only those methods that are called at runtime. However, these                     compiled methods are removed when they are not required.
  3. Normal-JIT: Normal-JIT compiles only those methods that are called at runtime. These methods are           complies the first time they are called, and then they are in cache. When the same methods are called             again, the compiled code from used for execution.

CLR - Common Language Runtime is heart of .NET framework and responsible to provide runtime environment while code execution. There is few key responsibilities of CLR listed below.
  -Garbage Collection: Automatically manages memory thus eliminating memory leaks. In simple work                                              release memories occupy unwanted objects.
  -Code Access Security: CAS grants rights to program depending on the security configuration of the                                                   machine.
  -Code Verification: This ensures proper code execution and type safety while the code runs.
  -IL (Intermediate Language): Refer MSIL Section of the article

CTS - In order that two language communicate smoothly CLR has CTS (Common type System). Example In VB you have "integer" and in C++ have "long" these datatypes are not compatible so the interfacing between them in very complicated. In order that these two different languages communicate microsoft introduced CTS. So "Integer" data type in VB6 and "int" data type in C++ will convert it to System.Int32, Which is data type of CTS. CLS is subset of the CTS which is nothing but guidelines, that launguage should follow so that it can communicate whith other .NET language sin s seamless manner.

Reference: Wikipedia, Shivprasad koirala's .Net Interview Questions book.

Search Terms : what is .net?, what is .net Frameworks?, what CLS?, what is CTS?, what is MSIL?, what JIT and it's Types?