Unit-1 Intro To .Net Framework
Unit-1 Intro To .Net Framework
NET Technology
What is .NET ?
Microsoft.NET is a Framework
– Microsoft .NET is a Framework which provides a common
platform to Execute or, Run the applications developed in
various programming languages.
app.exe
Languages
Win32
Win64 (XP,2K,98) WinCE
How is cross-platform achieved?
• Cross-platform execution realized in two
ways:
1. apps are written against Framework Class Library
(FCL), not underlying OS
• Goal?
– FCL is a portable operating system
(2) CLR-based execution
• Common Language Runtime must be present to execute
code:
APP.exe
OS Process
other FCL
JIT Compiler
components
Core
obj code
FCL
CLR
Underlying OS and HW
Monolithic
• Monolithic app: all source code compiled into
one .EXE
APP.exe
Component-based
• Component-based app: .EXE + 1 or more .DLLs
compute.dll
GUI.exe
data.dll
C++ C# VB Perl J# …
Operating System
• The .NET Framework consists of:
– The Common Language Specification (CLS)
It contains guidelines, that language should follow so that
they can communicate with other .NET languages. It is also
responsible for Type matching.
– The Framework Base Class Libraries (BCL)
A consistent, object-oriented library of prepackaged
functionality and Applications.
– The Common Language Runtime (CLR)
A language-neutral development & execution environment
that provides common runtime for application execution .
Common Language Specification
CLS performs the following functions:
• Establishes a framework that helps enable cross-language
integration, type safety, and high performance code
execution
• Provides an object-oriented model that supports the
complete implementation of many programming languages
• Defines rules that languages must follow, which helps
ensure that objects written in different languages can
interact with each other
Common Language Specification (CLS)
Native Code
Before
installation or
the first time
Execution each method is
called
Native JIT
Code Compiler
Assemblies
• Logical unit that contains compiled code targeted at the
.NET Framework
• Assembly is really a collection of types and resource
information that are built to work together and form a
logical unit of functionality
• DLL or EXE file
• Smallest deployable unit of .NET applications
• Difference between an assembly and a native .EXE or
.DLL- assemblies include metadata
• Any .net application- compile- assembly(.exe or .dll)
• Assembly contains IL and manifest
Assembly features
• Self- describing
• Versions dependencies are recorded inside an assembly
manifest
• Loaded side by side
• Assemblies are only loaded into memory if they are required.
If they aren't used, they aren't loaded. This means that
assemblies can be an efficient way to manage resources in
larger projects
Assembly structure
Assembly structure
• An assembly consists of
– assembly metadata describing the complete assembly
– type metadata describing the exported types and methods
– MSIL code
– resources
• All these parts can be inside one file or spread across several
files
Assembly Manifests
• Every assembly has an assembly manifest file.
• Assembly manifest contains:
– Identity – name, version, culture, and public key
– List of files - files that make up the assembly, such as other
assemblies you created that your .exe or .dll file relies on,
bitmap files, or Readme files.
– An assembly reference list, which is a list of all external
dependencies, such as .dlls or other files. Assembly
references contain references to both global and private
objects. This reference information includes the version
number and public key to uniquely identify assemblies.
Assembly Manifests
• A set of permissions requests- needed to run this assembly
• Exported types
– these are include if they are defined within a module and
the module is referenced from the assembly
– otherwise they are not part of manifest
– A module is a unit of reuse
– Type description is stored as metadata inside the assembly
• Some information in manifest can be modified using
attributes
Assembly version