0% found this document useful (0 votes)
64 views11 pages

CA607 - .NET Framework C# (Unit 1)

The document discusses the .NET Framework, which is a development framework created by Microsoft. It allows development in multiple languages and provides common functionality. The .NET Framework uses Common Language Runtime (CLR) to execute code. Programs developed with .NET languages are compiled to Microsoft Intermediate Language (MSIL) and then to native code by the Just-In-Time (JIT) compiler. Assemblies are the fundamental unit of deployment, containing MSIL, metadata, and resources. The .NET Framework provides a common type system and runtime for all .NET languages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views11 pages

CA607 - .NET Framework C# (Unit 1)

The document discusses the .NET Framework, which is a development framework created by Microsoft. It allows development in multiple languages and provides common functionality. The .NET Framework uses Common Language Runtime (CLR) to execute code. Programs developed with .NET languages are compiled to Microsoft Intermediate Language (MSIL) and then to native code by the Just-In-Time (JIT) compiler. Assemblies are the fundamental unit of deployment, containing MSIL, metadata, and resources. The .NET Framework provides a common type system and runtime for all .NET languages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

.

NET Framework and C#

Digital Notes By

NASHRA JAVED
(nashra@iul.ac.in)

Assistant Professor
Department of Computer Application,

Integral University, Lucknow

Session 2020-2021
.NET Basics
• The .NET Framework is a framework for developing and implementing software for personal computer, web etc.
• It was designed and is maintained by Microsoft Corporation.
• It came out around the year 2000, even though Microsoft started its development in early 90s.
• .NET has a rich collection of class library (called the Base Class Library) to implement GUI, query, database, web services etc.
• Programs developed with .NET needs a virtual machine to run on a host. This virtual machine is called Common Language Runtime
(CLR).
• Since the compiler doesn’t produce native machine code, and its product is interpreted by the CLR, there’s much security.
• .NET allows using types defined by one .NET language to be used by another under the Common Language Infrastructure (CLI)
specification, for the conforming languages.
• Any language that conforms to the Common Language Infrastructure (CLI) specification of the .NET, can run in the .NET run-time.
• Followings are some .NET languages.
– Visual Basic
– C#
– C++ (CLI version)
– J# (CLI version of Java)
– A# (CLI version of ADA)
– L# (CLI version of LISP)
– IronRuby (CLI version of RUBY)
• Microsoft provides a comprehensive Integrated Development Environment (IDE) for the development and testing of software with
.NET. Some IDEs are as follows
 Visual Studio
 Visual Web Developer
 Visual Basic
 Visual C#
Lecture Notes By Ms. Nashra Javed 2
.NET Framework Architecture

Lecture Notes By Ms. Nashra Javed 3


What is the .NET Framework?
• The .NET Framework is a new and revolutionary platform created by Microsoft for developing applications
• It is a platform for application developers
• 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 GUI in a GUI manner.
• .NET is a platform independent but with help of Mono Compilation System (MCS). MCS is a middle level interface.
• .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.
• The .NET Framework consists primarily of a gigantic library of code.

Definition:
A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NET
technologies, such as desktop applications and Web services.

Cross Language Integration


• You can use a utility of a language in another language (It uses Class Language Integration).
• .NET Framework includes no restriction on the type of applications that are possible. The .NET Framework allows the
creation of Windows applications, Web applications, Web services, and lot more.
• The .NET Framework has been designed so that it can be used from any language, including C#, C++, Visual Basic,
JScript, and even older languages such as COBOL.

Lecture Notes By Ms. Nashra Javed 4


Architecture of CLR
CLR is a runtime environment in which programs written in C# and other .NET languages are executed.

Lecture Notes By Ms. Nashra Javed 5


CLS (Common Language Specification)
It is a subset of CTS. All instruction is in CLS i.e. instruction of CTS is written in CLS.

Code Manager
• Code manager invokes class loader for execution.
• .NET supports two kind of coding
1. Managed Code
2. Unmanaged Code

Managed Code
• The resource, which is with in your application domain is, managed code. The resources that are within domain are
faster.
• The code, which is developed in .NET framework, is known as managed code. This code is directly executed by CLR
with help of managed code execution. Any language that is written in .NET Framework is managed code.
• Managed code uses CLR which in turns looks after your applications by managing memory, handling security,
allowing cross –language debugging, and so on.

Lecture Notes By Ms. Nashra Javed 6


Unmanaged Code
• The code, which is developed outside .NET, Framework is known as unmanaged code.
• Applications that do not run under the control of the CLR are said to be unmanaged, and certain languages such as
C++ can be used to write such applications, which, for example, access low - level functions of the operating system.
Background compatibility with code of VB, ASP and COM are examples of unmanaged code.
• Unmanaged code can be unmanaged source code and unmanaged compile code.
• Unmanaged code is executed with help of wrapper classes.
• Wrapper classes are of two types: CCW (COM callable wrapper) and RCW (Runtime Callable Wrapper).
• Wrapper is used to cover difference with the help of CCW and RCW.

Lecture Notes By Ms. Nashra Javed 7


Native Code
• The code to be executed must be converted into a language that the target operating system understands, known as
native code.
• This conversion is called compiling code, an act that is performed by a compiler.
• Under the .NET Framework, however, this is a two - stage process. With help of MSIL and JIT.

MSIL (Microsoft Intermediate Language)


• It is language independent code. When you compile code that uses the .NET Framework library, you don't immediately
create operating system - specific native code.
• Instead, you compile your code into Microsoft Intermediate Language (MSIL) code. The MSIL code is not specific to
any operating system or to any language.

JIT (Just-in-Time)
• Just - in - Time (JIT) compiler, which compiles MSIL into native code that is specific to the OS and machine
architecture being targeted. Only at this point can the OS execute the application. The just - in - time part of the name
reflects the fact that MSIL code is only compiled as, and when, it is needed.
• In the past, it was often necessary to compile your code into several applications, each of which targeted a specific
operating system and CPU architecture. Often, this was a form of optimization.
• This is now unnecessary, because JIT compilers (as their name suggests) use MSIL code, which is independent of the
machine, operating system, and CPU. Several JIT compilers exist, each targeting a different architecture, and the
appropriate one will be used to create the native code required.
• The beauty of all this is that it requires a lot less work on your part - in fact, you can forget about system - dependent
details and concentrate on the more interesting functionality of your code.
• JIT are of three types:
1. Pre JIT - It converts all the code in executable code and it is slow
2. Econo JIT - It will convert the called executable code only. But it will convert code every time when a code is
called again.
3. Normal JIT - 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.

Lecture Notes By Ms. Nashra Javed 8


Assemblies
• When you compile an application, the MSIL code created is stored in an assembly. Assemblies include both executable
application files that you can run directly from Windows without the need for any other programs (these have a .exe
file extension), and libraries (which have a .dll extension) for use by other applications.
• In addition to containing MSIL, assemblies also include meta information (that is, information about the information
contained in the assembly, also known as metadata) and optional resources (additional data used by the MSIL, such as
sound files and pictures).
• The meta information enables assemblies to be fully self - descriptive. You need no other information to use an
assembly, meaning you avoid situations such as failing to add required data to the system registry and so on, which
was often a problem when developing with other platforms.
• This means that deploying applications is often as simple as copying the files into a directory on a remote computer.
Because no additional information is required on the target systems, you can just run an executable file from this
directory and (assuming the .NET CLR is installed) you're good to go.
• Of course, you won't necessarily want to include everything required to run an application in one place. You might
write some code that performs tasks required by multiple applications. In situations like that, it is often useful to place
the reusable code in a place accessible to all applications. In the .NET Framework, this is the Global Assembly Cache
(GAC). Placing code in the GAC is simple - you just place the assembly containing the code in the directory
containing this cache.

Garbage Collection (GC)


• One of the most important features of managed code is the concept of garbage collection. This is the .NET method of
making sure that the memory used by an application is freed up completely when the application is no longer in use.
• Prior to .NET this was mostly the responsibility of programmers, and a few simple errors in code could result in large
blocks of memory mysteriously disappearing as a result of being allocated to the wrong place in memory. That usually
meant a progressive slowdown of your computer followed by a system crash.
• .NET garbage collection works by inspecting the memory of your computer every so often and removing anything
from it that is no longer needed. There is no set time frame for this; it might happen thousands of times a second, once
every few seconds, or whenever, but you can rest assured that it will happen.

Lecture Notes By Ms. Nashra Javed 9


References

For Content

https://www.geeksforgeeks.org/introduction-to-net-framework/
https://dotnet.microsoft.com/learn/dotnet/what-is-dotnet-framework
https://www.c-sharpcorner.com/uploadfile/puranindia/net-framework-and-architecture/

For Images

www.google.com

Lecture Notes By Ms. Nashra Javed 10


THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy