You are on page 1of 25

Introduction to .

NET
Micro-Soft took many of the best ideas in the industry,

added their own creativity and innovations and


produced a coherent systems solution popularly
known as Micro-Soft .NET.
.NET is platform Dependent (only for windows) but in
near future it is going to be platform independent.
Platform means the combination of hardware and
operating system.

In Case of Normal Language

H/W

Source
Code

Compiler

Target
Platform

In Case of the JAVA

H/W

Source
Code

Compiler

Byte
Code
Class file

JVM

Target
Platform

In Case of the .NET

H/W

Source
Code

Compiler

MSIL
Code
PE file

CLR

Target
Platform

Introduction to .NET
The PE (Portable Executable) file is language

independent.
The code of PE file will be same if object of two
different programs language code is same. Even if its
codes are different due to different syntax.
The PE file is not machine code . It is similar to
machine code .

Introduction to .NET
Commonly used four languages by .NET

VB.Net
C#.Net
J#.Net
VC++.Net

You can write code in C# or VB.NET with the same


number of lines of code, same performance and
same efficiency because everyone uses same .NET
library.
.NET framework comes with a single class library.
There is no classes specific to any language .

Introduction to .NET
.NET develops the application that can be
accessed any time, any where , any device.
.NET is the technology from Micro-Soft, on

which all other Micro-Soft technologies will be


depending on in future.
The future versions of windows , .Net will be
freely distributed as a part of operating system
and users will never have to install .NET
separately.

.NET
Platform

The .NET Platform offers a complete suite for developing and deploying
applications. This suite consists of
.NET products:
Microsoft has introduced Visual Studio .NET IDE, which is a tool for
developing .NET applications.
NET programming languages: Visual Basic, Visual C#,Visual J# and
Visual C++.
All .NET products use eXtensible Markup Language (XML) for
describing and exchanging data between applications.
.NET services:
Web services: A Web service is an application or business logic that
is accessible through standard Internet protocols such as HTTP and
SOAP.
The .NET Framework:
It is a foundation for developing, designing and deploying
applications.
It exists as a layer between .NET applications and the underlying
operating system.

.NET Framework
The .NET Framework, introduced by Microsoft, aims at

integrating various programming languages and services.


The .NET Framework is designed to make significant

improvements in code reuse, code specialization, resource


management, multi language development, security,
deployment, and administration.
The .NET Framework consists of all the technologies that help

in creating and running robust, scalable, and distributed


applications.

Components of the .NET Framework

The .NET Framework consists three main components.


They are:
Common Language Runtime (CLR)
The .NET Framework Base Classes
The user interface

Components of the .NET Framework


The following figure displays the various components of the
.NET Framework.

Common Language Runtime (CLR)

.NET Framework Class Libraries

Windows
Forms

Console
Applications

Web Forms and


Web Services

Common Language Runtime (CLR):


CLR is the environment where all programs in .NET are executed.
CLR provides services such as code compilation, memory allocation, and

garbage collection.
IL is a low level language that the CLR understands.

IL is converted into machine language during execution by the JIT

compiler. During JIT compilation, code is also checked for type safety.

Common Language Runtime (CLR):


CLR consists of a set of common rules followed by all the languages of

the .NET Framework. This set of rules is known as Common Language


Specification (CLS).
One of the specifications defined in CLS is CTS, which provides a type

system that is common across all languages. CTS define how data types
are declared, used, and managed in the code at run time.
While executing the program, CLR:

Identifies the process of compilation

Identifies the process of code execution

.NET
source
code

Language
Compiler

The Common Language Runtime


MSIL
+
Metadata

CLR

Machine
code

Code
executed

Manages memory
Makes it easy to design
components &
applications whose
objects interact across
languages

Cross-language
integration (especially
cross-language
inheritance)
Compile once, and run on any
CPU & OS that supports the
runtime!

Features of CLR
Features Provided by the CLR:

Automatic memory management


Standard type system
Language interoperability
Platform independence
Security management
Type safety

The .NET Framework Base Classes

The .NET Class Framework Class Library

is built on the object-oriented nature of the runtime.


provides classes that can be used in the code to

accomplish a range of common programming tasks,


such as string management, data collection, database
connectivity, and file access.

can be used in a consistent manner across multiple


languages.

comprises namespaces, which are contained within


assemblies.

The .NET Framework Base Classes


The .NET Class Framework Class Library includes
Namespaces help you to
create logical groups of related classes and interfaces that can be used by

any language targeting the .NET Framework.


avoid any naming conflicts between classes that have the same names.
Assembly
is a single deployable unit that contains all the information about the
implementation of classes, structures, and interfaces.
stores all the information about itself. This information is called
metadata.
provides the CLR with the information required for executing an
application.
plays an important role in deployment and versioning.

User and Program Interfaces

.NET provides three types of user interfaces:

Windows Forms: They are used in Windows-based applications

Web Forms: They are used in Web-based applications

Console Applications: They are used to create character-based


console applications that can be executed from the command line.

.NET provides one program interface:

Web Services: They are used to communicate with remote


components

Advantages of the .NET Framework


Consistent programming model
Multi-platform applications
Multi-language integration

Automatic resource management


Ease of deployment

Visual Studio .NET IDE


The Solution Explorer Window:

The Solution Explorer window lists the solution name, the project name, and all
the classes that are used in the project.

Visual Studio .NET IDE


The Output Window:

The Output window displays messages for the status of various features
provided in the Visual Studio .NET IDE.

Visual Studio .NET IDE


The Error List Window:

The Error List window displays a list of errors along with the source (the file
and the line number) of the error. It helps you identify and locate problems that
are detected automatically as you edit or compile code.

Visual Studio .NET IDE


The Class View Window:

The Class View window displays the classes, methods, and properties
associated with a particular file. They are displayed in a hierarchical tree-view
depicting the containership of these items.

Visual Studio .NET IDE

To compile and execute the application, you need to perform the


following steps:
1. Select BuildBuild Solution or press F6 to compile the application.
2. Select DebugStart Debugging or press F5 to execute the

application.

You might also like