You are on page 1of 17


NET Framework
Session 1

1. 2. 3. 4. 5. 6. .NET Framework architecture. C# vs Java. .NET Framework component. Advantages of .NET Framework . Framework Classes. CLR

What is .NET framework

.NET is a new technology for building modern

application that can be executed any modern operating system and modern devices like PCs,servers,palm-tops etc. .NET is the Microsoft services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions.

The .NET Framework has been designed so that it can be used from any language, including C# as well as C++, Visual Basic, JScript, and even older languages such as COBOL. (.NET is platform independent. As of now it can work on Windows and Linux OS because MS has launched only two JIT(Just In Time) compilers one for each OS. If MS launches JIT compilers for other OS it will be able to run in them too.)

It provides complete environment to developers for developing 1)Windows application 2)Web application(ASP.NET) 3)Console application 4)Class libraries 5)Web Services

The key features of .NET framework are: A) Base Class Library:- The base class library of .NET framework contains rich collection of classes that are available to developer for codes. B)Common Language Runtime:- It is heart of .NET framework. .NET framework provides a runtime environment called the Common Language Runtime or CLR. CLR engine does not compile the code in machine code butconverts the code in a set of instructions called Microsoft IntermediateLanguage (MSIL).(Similar to JVM in Java). C)Class Loader:-class loader is component of .NET framework's runtime which loads the classes from class library as required by MSIL.

D) Assemblies: Assemblies are the fundamental units of

deployment, version name, securities permissions etc. An assemblies is a .NET executable program or unit of deployment like EXE or DLL that delivered as a single unit. When you build a C# windows or console application, the .exe file produced is an assembly. If you build a class library the DLL file produced is also an assembly. Multiple versions can be deployed side by side in different folders. These different version can be executed at the same time without interfering with each other.

Life as a Visual Basic 6.0

VB6 is popular due to its ability to build complex user interfaces, code libraries (e.g., COM servers), and data access logic with minimal headache. Down back of VB6 VB6 is that it is not a fully object-oriented language. For example, VB6 does not allow the programmer to establish classical inheritance.

C# provides greater expressiveness & writes performance critical code . Operator Overloading is possible in C#, but not in JAVA. JAVA runs on any machine with JVM, whereas C# on CLR. Applets in JAVA, similar to Web Forms/Win Forms in C#.

In JAVA, the lang package is automatically imported, whereas in C# you have to explicitly specify Using System. There is no partial class concept in JAVA,but it is present in C#.

.NET Framework component

A runtime environment, called the "Common Language Runtime" (CLR) that handles memory allocation, error trapping, and security features. A set of extensive Framework class libraries, written from the ground up that comprise practically any functionality . Two top-level development, for web applications (ASP.NET) and regular Windows applications (Windows Forms).

.NET Framework Classes

Services Description Discovery Protocols Caching Configuration UI HtmlControls WebControls Security SessionState

Form MessageBox Button ListControl

Drawing2D Imaging XSLT XPath Printing Text Serialization
By Anil Kumar

OLEDB Design Collections Configuration Diagnostics Globalization SQL SQLTypes IO Net Reflection Resources


Security ServiceProcess Text Threading Runtime InteropServices Remoting Serialization

What is IL?
Intermediate Language is also known as MSIL or CIL. 1) All .NET source code is compiled to IL. 2) IL is then converted to machine code at run time by JIT Compiler & uses the CPU architecture of target machine for executing a .NET application.

What is CLR?
It is heart of .NET framework. .NET framework provides a runtime environment called the Common Language Runtime or CLR.(Similar to JVM in Java). CLR manages code execution at runtime. Following are the responsibilities of CLR.

Development services
Deep cross-language interoperability Increased productivity

Deployment services
Simple, reliable deployment Fewer versioning problems NO MORE DLL HELL

Run-time services
Performance Scalability Availability

System Management -Memory management -Thread management, etc.

Garbage Collection:
CLR automatically manages memory thus eliminating memory leaks

Code Access Security:

CAS is part of .NET security model that determines whether a piece of code is allowed to run and what resources it can use while running.

Code Verification:
This ensures proper code execution while the code runs.

CLR Execution Model

Source code Managed code
VB Compiler Assembly IL Code C# Compiler Assembly IL Code C++ Compiler Assembly IL Code Unmanaged Component

Common Language Runtime

JIT Compiler
Native Code

Operating System Services

.NET Framework. .NET Classes. Common Language Runtime.