Sie sind auf Seite 1von 11

.

NET Framework
Yogendra Tamang

30 July, 2017
Outline
Introduction and Background
Compilation
CLS and CTS
CLR
Base Class Libraries
.NET Framework
It is framework for building software systems.
.Net Framework provides Runtime Environment and Comprehensive
Base Class libraries(BCL).
The run time layer is called Common Language Runtime(CLR).
Key Features
1. Multi-language Support:
Various languages(C#, F#, Visual Basic etc.) can be used to create .NET
Application
2. Single runtime engine:
Various languages follow fixed standard and they all run on single engine.
3. Comprehensive Base Class Libraries:
.Net Framework has predefined set of libraries through which you can build
code libraries, console(terminal) applications, graphical desktop applications,
web applications etc.
Key Features (Contd..)
1. Language Integration
There is cross language inheritance (You can write class in C# and extend it on
Visual Basic), cross language debugging and cross language exception handling.
2. Simple Deployment
3. Interoperability with existing code
.NET Framwork is backward-compatible and even can comingle with
COM(Component Object Model) based Softwares.
Compilation
Two Phase Compilation
First Phase: CIL Generation from .NET Aware Compilers
Last Phase: Machine Code from JIT Compiler.

CIL

Jitter

Machine code

Figure 1 : First Phase Compilation Figure 2 : Second Phase Compilation


Compilation
Code Written in .NET Aware Language(C#, VB etc.) are compiled by
.NET Aware Compiler(C Sharp Compiler, Visual Basic Compiler etc.)
and .Net Binary blob is created.
.Net binary blob is also termed as Assembly and it contains Common
Immediate Language(CIL)* and Metadata.
JIT** compilers compile CIL codes to platform specific instructions.
In this way compilation of .Net Code is done
* CIL is also termed as MicroSoft Intermediate Language(MSIL) or just Intermediate
Language (IL).
**Just In Time (JIT) or Jitters compiles IL into Machine code on the fly.
Common Language System(CLS)
CLS says how computer programs can be turned to CIL.
It is agreement among language designers and class library designers
to use common subset of basic feature that all languages have to
follow.
Multi Language Support is possible due to CLS.
Common Type System (CTS)
Types are Classes, Delegates, Enumeration, Structures and Interface
CTS is formal specification that documents how types are declared,
used and managed.
CTS provides Object Oriented Model and it also provides a library
primitive data type.
It helps to enable cross language integration, type safety and high
performance code execution.
Common Language Runtime
Its a collection of services that are required to execute a given
compiled unit of code.
It is responsible for resolving location of assembly and finding the
requested type within binary by reading contained metadata
It loads custom assemblies, creates custom types, interacts with types
contained in .NET Base Class Libraries