Friday, June 29, 2012

FrameWork Runtime

.Net framework runtime is a protective bubble that wraps around your application.It prevents you from worrying about allocating and deallocating of memory for your variables.In some cases it protects the end user machine from unauthorized access of external resources.It basically is a protective layer that provides some benefits to the developer and end user.

when you write a c# code,in order for that code to be executed,it has to be compiled first.That process is called compilation in which it converts human readable code to machine readable code.The end result of compilation is a file called assembly . There is two types of assembly files . They are
1 .exe files
2 .dll files

.exe files - means executable assemblies. You can find it in the windows explorer.
.dll files - stands for dynamic link library.Basicaly it is a library of code shared by applications .

Debug assembly VS Release Assembly

when you are debugging, a debug version of assembly has been added to the debug folder in your project. And release version of assembly is created in the release folder. If you want to give your application to some body else,at the minimum we have to give the release version of the assembly and they also wanted to have the .net framework runtime.

Two phases of compilation
1. Parsing and compiling into Common Intermediate Language(CIL)- It goes through your code and make sure you didnt made any obvious mistakes, that is , certain kinds of errors that makes compilation to stop .
Once that is done the compiler converts the c# code into CIL code.This allows you to write an application in C# or java or vb.net or any other language ,they all get compiled into CIL.
After that Compiler adds the bootstrap code calling the .NET runtime.

2.Just In Time Compilation - In computing, just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance of computer programs..Net handles the hardware configuration and operating systems. The .net runtime evaluates the computers OS and the hardware and it creates the optimised version of the assembly that is specific to that configuration and it saves the application in a cache. This optimised version saved in cache is used in the future.

Integrated Development Environment(IDE) States
1.Design time - writing code time.
2.compile time- when you decide the compile or debug the application to create the debug or release version of the assembly.
3.Run time- Application running time or executing time.At this time unexpected errors pops up.They are called exceptions.
4.Debug time- this is a mix between design time and runtime.

No comments:

Post a Comment