0% found this document useful (0 votes)
26 views42 pages

Unit 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 42

Mukesh Rajput

Asst. Prof.
DBUU
 Dot net is a technology created by Microsoft
Company to develop multiple applications.

 Console Application
 Windows Application
 Web Application
 Web Services
 Web API
The .NET Framework is revolutionary
platform created by Microsoft for
developing applications.
Version number CLR version Release date
1.0 1.0 13-02-2002
1.1 1.1 24-04-2003
2.0 2.0 11-07-2005
3.0 2.0 07-11-2006
3.5 2.0 19-11-2007
4.0 4 12-04-2010
4.5 4 15-08-2012
4.5.1 4 17-10-2013
4.5.2 4 05-05-2014
4.6 4 20-07-2015
4.6.1 4 17-11-2015
4.6.2 4 02-08-2016
4.7 4 05-04-2017
4.7.1 4 17-10-2017
4.7.2 4 30-04-2018
4.8 4 18-04-2019
Version .NET Framework Visual Studio
C# 1.0 .NET Framework 1.0/1.1 Visual Studio .NET 2002
C# 2.0 .NET Framework 2.0 Visual Studio 2005

C# 3.0 .NET Framework 3.0\3.5 Visual Studio 2008

C# 4.0 .NET Framework 4.0 Visual Studio 2010

C# 5.0 .NET Framework 4.5 Visual Studio 2012/2013


C# 6.0 .NET Framework 4.6 Visual Studio 2013/2015

C# 7.0 .NET Core 2.0 Visual Studio 2017

C# 8.0 .NET Core 3.0 Visual Studio 2019

C# 9.0 .NET 5.0 Visual Studio 2019

C# 10.0 .NET 6.0 Visual Studio 2022


 .NET Framework is a Windows-only version of
.NET for building client and server
applications.
 It is a platform for application developers.
 Dot net Support 65+ languages.
 It is a Framework that supports Multiple
Language and Cross language integration.
 IT has IDE (Integrated Development
Environment).
 Framework is a set of utilities or can say
building blocks of your application system.
 .NET Framework provides interoperability
between languages i.e. Common Type System
(CTS).
 .NET Framework also includes the .NET
Common Language Runtime (CLR), which is
responsible for maintaining the execution of
all applications developed using the .NET
library.
 A programming infrastructure created by
Microsoft for building, deploying, and running
applications and services that use .NET
technologies, such as desktop applications and
web applications.
 The .NET Framework is made up of two major
components: the common language runtime (CLR)
and the framework class library (FCL). The CLR is
the foundation of the .NET Framework and
provides various services that applications can
use. The FCL is a collection of over 7000+ types
that fulfill all the services, and data structures that
applications will ever need.
 The Common Language Runtime (CLR) is an
Execution Environment.
 It works as a layer between Operating
Systems and the applications written in .Net
languages that conforms to the Common
Language Specification (CLS).
 The main function of Common Language
Runtime (CLR) is to convert the Managed
Code into native code and then execute the
Program.
 The Managed Code compiled only when it
needed, that is it converts the appropriate
instructions when each function is called.
 The Common Language Runtime (CLR)'s Just
In Time (JIT) compilation converts
Intermediate Language (MSIL) to native code
on demand at application run time.
 During the execution of the program, the
Common Language Runtime (CLR) manages
memory, Thread execution, Garbage
Collection (GC), Exception Handling, Common
Type System (CTS), code safety verifications,
and other system services. The CLR (Common
Language Runtime) defines the Common
Type System (CTS), which is a standard type
system used by all .Net languages.
 That means all .NET programming languages
uses the same representation for common
Data Types , so Common Language Runtime
(CLR) is a language-independent runtime
environment.
 The Common Language Runtime (CLR)
environment is also referred to as a managed
environment, because during the execution
of a program it also controls the interaction
with the Operating System.
 CLS stands for Common Language Specification
and it is a subset of CTS. It defines a set of rules
and restrictions that every language must follow
which runs under .NET framework. The languages
which follows these set of rules are said to be CLS
obedient. In simple words, CLS enables cross-
language integration.
 Common Language Specification (CLS) is a set of
basic language features that .Net Languages
needed to develop Applications and Services, which
are compatible with the .Net Framework.
 When there is a situation to communicate Objects
written in different .Net languages, those objects
must expose the features that are common to all
the languages.
 Common Language Specification (CLS)
ensures complete interoperability among
applications, regardless of the language used
to create the application.
 Common Language Specification (CLS)
defines a subset of Common Type System
(CTS).
 For example, one rule is that you cannot use
multiple inheritance within .NET Framework.
As you know C++ supports multiple
inheritance but; when you will try to use that
C++ code within C#, it is not possible
because C# doesn’t supports multiple
inheritance.
 Common Type System (CTS) describes a set
of types that can be used in different .Net
languages in common.
 That is, the Common Type System (CTS)
ensure that objects written in different .Net
languages can interact with each other. For
Communicating between programs written in
any .NET language.
 These types can be Value Types or Reference
Types. The Value Types are passed by values
and stored in the stack.
 The Reference Types are passed by
references and stored in the heap.
 Common Type System (CTS) provides base
set of Data Types which is responsible for
cross language integration.
 The Common Language Runtime (CLR) can
load and execute the source code written in
any .Net language, only if the type is
described in the Common Type System (CTS).
 A.NET programming language (C#, VB, J#
etc.) does not compile into executable code;
instead it compiles into an intermediate code
called Microsoft Intermediate Language
(MSIL). Since our source code is automatically
converted to MSIL.
 The MSIL code is then send to the CLR
(Common Language Runtime) that converts
the code to machine language, which is, then
run on the host machine.
 MSIL is similar to Java Byte code.
 MSIL is the CPU-independent instruction set
into which .NET Framework programs are
compiled. It contains instructions for loading,
storing, initializing, and calling methods on
objects.
 Combined with metadata and the common
type system, MSIL allows for true cross-
language integration Prior to execution, MSIL
is converted to machine code.
 The .NET Framework class library is a library of
classes, interfaces, and value types that provide
access to system functionality.
 It is the foundation on which .NET Framework
applications, components, and controls are
built.
 Path of .Net Framework in Windows
 C:\Windows\assembly-For .NET 2.0 -3.5
assembly
 C:\Windows\Microsoft.NET\assembly-For .NET
4.0 assemblies
 The System namespace contains fundamental
classes and base classes that define
commonly-used value and reference data
types, events and event handlers, interfaces,
attributes, and processing exceptions.
Namespace Description
System The System namespace contains fundamental
classes and base classes that define commonly-
used value and reference data types, events and
event handlers, interfaces, attributes, and
processing exceptions.
System.Collections The System.Collections namespaces contain
types that define various standard, specialized,
and generic collection objects.
System.Configuration The System.Configuration namespaces contain
types for handling configuration data,
such as data in machine or application
configuration files. Child namespaces contain
types that are used to configure an assembly, to
write custom installers for components,
and to support a pluggable model for adding
functionality to, or removing
functionality from, both client and server
applications.
System.Data The System.Data namespaces contain classes for accessing and
managing data from diverse sources. The top-level namespace
and a number of the child namespaces together form the
ADO.NET architecture and ADO.NET data providers.
For example, providers are available for SQL Server, Oracle,
ODBC, and OleDB.
Other child namespaces contain classes used by the ADO.NET
Entity Data Model (EDM) and by WCF Data Services.
 The .Net languages, which is conforms to the
Common Language Specification (CLS), uses its
corresponding runtime to run the application on
different Operating Systems. During the code
execution time, the Managed Code compiled only
when it is needed, that is it converts the
appropriate instructions to the native code for
execution just before when each function is
called. This process is called Just In Time (JIT)
compilation, also known as Dynamic Translation.
With the help of Just In Time Compiler (JIT) the
Common Language Runtime (CLR) doing these
tasks.
 The Common Language Runtime (CLR) provides
various Just In Time compilers (JIT) and each
works on a different architecture depending on
Operating System. That is why the same
Microsoft Intermediate Language (MSIL) can be
executed on different Operating Systems without
rewrite the source code. Just In Time (JIT)
compilation preserves memory and save time
during application initialization. Just In Time
Compiler (JIT) code generally offers far better
performance than interpreters.
 Pre JIT
 Econo JIT
 Normal JIT
 It converts all the code in executable code
and it is slow.
 It will convert the called executable code
only. But it will convert code every time when
a code is called again.
 It will only convert the called code and will
store in cache so that it will not require
converting code again. Normal JIT is fast.
 CLR also contains Garbage Collector (GC) which
runs in a low-priority thread and checks for un-
referenced dynamically allocated memory space.
If it finds some data that is no more referenced
by any variable/reference, it re-claims it and
returns the occupied memory back to the
Operating System; so that it can be used by other
programs as necessary. The presence of standard
Garbage Collector frees the programmer from
keeping track of dangling data.
 Microsoft .Net Assembly is a logical unit of
code, that contains code which the Common
Language Runtime (CLR) executes.
 It is the smallest unit of deployment of a .net
application and it can be a .dll or an exe.
 Assembly is really a collection of types and
resource information that are built to work
together and form a logical unit of
functionality.
 It include both executable application files
that you can run directly from Windows
without the need for any other programs
(.exe files), and libraries (.dll files) for use by
other applications.
 Assemblies are the building blocks of .NET
Framework applications.
 During the compile time Metadata is created
with Microsoft Intermediate Language (MSIL)
and stored in a file called Assembly Manifest .
 Both Metadata and Microsoft Intermediate
Language (MSIL) together wrapped in a
Portable Executable (PE) file (an .exe or .dll).
 Assembly Manifest contains information
about itself. This information is called
Assembly Manifest, it contains information
about the members, types, references and all
the other data that the runtime needs for
execution.
 We can create two types of Assembly:
 1. Private Assembly
 2. Shared Assembly

 1. Private Assembly :
 A private Assembly is used only by a single
application, and usually it is stored in that
application's install directory.
 2. Shared Assembly :
 A shared Assembly is one that can be
referenced by more than one application. If
multiple applications need to access an
Assembly, we should add the Assembly to the
Global Assembly Cache (GAC).
 Each computer on which the Common
Language Runtime is installed has a machine-
wide code cache called the 'Global Assembly
Cache'.
 GAC is a folder in Windows directory to store
the .NET assemblies that are specifically
designated to be shared by all applications
executed on a system.
 Assemblies can be shared among multiple
applications on the machine by registering
them in global Assembly cache(GAC).
 The GAC is automatically installed with the
.NET runtime. The global assembly cache is
located in 'Windows' directory and inherits the
directory's access control list that
administrators have used to protect the
folder.
 A namespace is designed for providing a way
to keep one set of names separate from
another. The class names declared in one
namespace does not conflict with the same
class names declared in another.
 Defining a Namespace:
 A namespace definition begins with the
keyword namespace followed by the
namespace name as follows:
 namespace namespace_name {
 // code declarations
 }

You might also like