.Net Framework

1.What is Framework ?
Framework is special kind of libraries or structures that helps in building applications.

2.What is .Net Framework ?
It is collection of libraries and API designed by microsoft which helps in building,deploying and running applications and services that use >net technologies. 
In simple words a .net framwork is a combination of several diff technology like CLR,asp.net,garbage collection etc that helps in easing the process of software development.


3.What are the features of .Net framework ?
MSIL,CLR,CTS,Assemblies



4.Briefly explain how the code is compiled by the framework ?
The .net code first is compiled into MSIL/IL i.e intermediate language which is machine independant. At this stage metadata is generated which contains the member signature.This code then gets compiled into machine specific language known as native language by JIT(just in time ) compiler.


5.What is JIT ?
Just -In-Time compiler compiles the IL code to native code so that the machine can understand that language.JIT runs on demand when a method is called JIT analysis the IL and produces highly efficient code. So if the next time same piece of code i execitued then it runs and not compiled.JIT is specific to OS.


6.What is AOT ?
Ahead-Of-Time compilation.the JIT runs just before the code execution hence it does not have enough time of optimize the code. hence cam AOT.It compiles the entire .net assembly into IL during application installation.
ngen is a type of AOT



7.What is ngen.exe ?
Native Image Generator.It compiles the entire assembly during installation.
It creates native images that are nothing but files so that the next time compiles compiles it picks up these images instead of files from JIT.
This helps in faster compilation.It can be used only if ngen is used for all the assembly in the application.


8.How MSIL helps in language interopability ?
MSIL is machine independant language.no matter which language you use in .net all of then are converted into MSIL .thus helping diff language coexist with each other.


9.What is CLR?
Common language runtime.it is the heart of .net framework and it takes care of code execution.It helps in running your program by acting as a translator between your program and the computer you are running it on.features of CLR -
a)Garbage Collection-helps in automatic memory management by disposing or the objects when they are not being referenced anymore. 
b)IL to native code -CLR uses JIT compiler to convert MSIL to native code.
c)Code access security(CAS)-provides right to certain programs. eg if a piece of code is trying to delete a file for which it does not have permission, CLR prevents it from doing so.
d)Code verification-ensures type safety and prevents code from accessing invalid memory locations etc.


10.What is CTS ?
Common type system ,defines set of data types that are common for all the languages in .net.eg-long in vb.net and int in c# both point to system.int32 in IL.

11.What is CLS ?
Common language specification,defines rules that all the languages must follow in order to co-exist among each other.

8.What are languages supported in .Net ?
it supports over 60 languages some of them are-c#,ada,C++, j#,Perl,VB,cobol etc.

9.What is .Vshost ?
when we build our vs project this exe is created in the bin folder.it is a hosting process.and is used only by visual studio.it helps in imporving performance and supports immediate window.

10.what is managed and unmanaged code ?
the code which runs under CLR is called managed code eg-VB,C#.
the code which is not compiled by CLR is called unmanaged code.eg-C++


Note:Also read About Assemblies

3 comments: