0% found this document useful (0 votes)
10 views9 pages

404 VB Chap1

The .NET Framework is a software development framework by Microsoft that provides libraries, tools, and runtime environments for building applications on Windows using languages like C# and VB.NET. It utilizes a Common Language Runtime (CLR) to manage code execution and memory, converting code into Microsoft Intermediate Language (MSIL) for portability across different programming languages. The framework includes a Base Class Library (BCL) for common functions, supports web services, and enforces a Common Language Specification (CLS) for interoperability among languages.

Uploaded by

8t46ct85bb
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)
10 views9 pages

404 VB Chap1

The .NET Framework is a software development framework by Microsoft that provides libraries, tools, and runtime environments for building applications on Windows using languages like C# and VB.NET. It utilizes a Common Language Runtime (CLR) to manage code execution and memory, converting code into Microsoft Intermediate Language (MSIL) for portability across different programming languages. The framework includes a Base Class Library (BCL) for common functions, supports web services, and enforces a Common Language Specification (CLS) for interoperability among languages.

Uploaded by

8t46ct85bb
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/ 9

1.Overview of Microsoft .

NET Framework

What is Framework?
• The .NET Framework is a software development framework created by Microsoft. It provides a large set of libraries,
tools, and runtime environments for building and running applications on Windows. The framework allows developers to
create desktop applications, web applications, and services using languages like C#, Visual Basic .NET (VB.NET)

The .NET Framework is an environment for developing and executing applications. By default .NET comes with few
programming languages including C# (C Sharp), VB.NET, J# and managed C++. .NET is a common platform for all the
.NET supported languages. It gives a common class library, which can be called from any of the supported languages. So,
developers need not learn many libraries when they switch to a different language. Only the syntax is different for each
language.

When you write code in any language and compile, it will be converted to an 'Intermediate Language' (Microsoft
Intermediate Language - MSIL). So, your compiled executable contains the IL and not really executable machine language.
When the .NET application runs, the .NET framework in the target computer take care of the execution. (To run a .NET
application, the target computer should have .NET framework installed.) The .NET framework converts the calls to .NET
class libraries to the corresponding APIs of the Operating system.

Whether you write code in C# or VB.NET, you are calling methods in the same .NET class libraries. The same .NET
framework executes the C# and VB.NET applications. So, there won't be any performance difference based on the language
you write code.

The .NET Framework is a environment for developing and executing applications. The .NET Framework manages all
aspects of program execution, like, allocation of memory for the storage of data and instructions, granting and denying
permissions to the application, managing execution of the application and reallocation of memory for resources that are not
needed.

Version of .Net Framework :


(1) .Net Framework 1.0
(2) .Net Framework 1.1
(3) .Net Framework 2.0 .
(4) .Net Framework 3.0
(5) .Net Framework 3.5
(6).Net Framework 4.8.1

Narrow view of .NET Application:-

pg. 1
Architecture of .net Framework :-

pg. 2
Common Language runtime(CLR) :-

• It is heart of .NET.

• Engine to compile and run the application.

• Convert code into MSIL format (PE file).

• It makes .NET Language Independent.

• MSIL code gets translated JIT by JIT compiler.

• It support component — based programming.

• CLR manages code execution at runtime Memory management, thread management, etc.

Working of the CLR:-

When the .NET program is compiled, the output of the compiler is not an executable file but a file that contains a special
type of code called the Microsoft Intermediate Language (MSIL), which is a low-level set of instructions understood by
the common language run time. So, your compiled executable contains the IL and not really executable machine language.
This MSIL defines a set of portable instructions that are independent of any specific CPU.

It's the job of the CLR to translate this Intermediate code into an executable. When the .NET application runs, the .NET
framework in the target computer take care of the execution. (To run a .NET application, the target computer should have
.NET framework installed.) The .NET framework converts the calls to .NET class libraries to the corresponding APIs of
the Operating system.

(And that's how the .NET Framework achieves Portability. This MSIL is turned into executable code using a JIT (Just In
Time) complier. The process goes like this, when .NET programs are executed, the CLR activates the JIT complier. The
JIT complier converts MSIL into native code on a demand basis as each part of the program is needed.)

pg. 3
Base class Libraries(BCL) :-

• It is also known as Framework Class Library (FCL).

• It is library of types available to all languages using .NET

• It provides classes, which encapsulate a number of common function, including file reading & writing,
graphic rendering, database interaction and XML document manipulation.
• It is object oriented Object-oriented collection of reusable types.

ADO.NET
• It is a set of computer software components.

• It is use to access data & data services.

• It is a part of BCL. It Consist of 2 parts


o Data provider
o Dataset
Window Forms
• It is Used to create GUI for windows desktop application.

• It also Provide an integrated and unified way of developing GUI.

• It has rich variety of windows controls and user interface support. E.g. Textbox, button, check box,
containers controls etc.
pg. 4
Web Forms & web Services
• It Provides tools for web application.

• It is as a part of ASP.NET.

• They are forms engine, that provide a browser-based user interface.

Web Services
• They are small unit of code.

• They are design to handle limited set of task.

• It used XML based communicating protocols.

• They are independent of Operating System and programming languages. It connects people, system,
devices.
• UDDI (Universal Description, Discovery and Integration)
o It is a directory services where web services businesses can register and search for web services.
• WSDL (Web Services Description Language).

• HTTP (Hyper Text Transfer Protocol).


o It is a World Wide Web standard use of communication over the internet.
• XML (Extensible Markup Language)
o Standard for storing, carrying, and exchanging data.
• SOAP (Simple Object Access Protocol)
o It is a lightweight platform and language neutral communication protocol that allows programs to
communicate via Internet standard HTTP protocol.

The common Language Specification(CLS) :-

o CLS Stands for common language specification. • It defines set of rules which every .Net language has
to follow.

• The CLS is a common platform that integrates code and components from multiple .NET programming languages.
‫ ٭‬In other words, a .NET application can be written in multiple programming languages with no extra work by the
developer

• The CLS defines the minimum standards that .NET language compilers must conform to, and
ensures that any source code compiled by a .NET compiler can interoperate with the .NET
Framework.

1.1.1 Managed Code MSIL, Metadata and JIT Compilation-Automatic Memory Management

• Managed Code MSIL:

• What is MSIL code?


The Microsoft Intermediate Language (MSIL), also known as the Common Intermediate
Language (CIL) is a set of instructions that are platform independent and are generated
by the language-specific compiler from the source code.

pg. 5
• A .NET programming language (C#, VB.NET, J# etc.) does not compile into executable code; instead it

compiles into an intermediate code called Microsoft Intermediate Language (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. A Java program is compiled into Java Byte code (the .class file) by a

Java compiler, the class file is then sent to JVM which converts it into the host machine language. • During
the compile time, the compiler converts the source code into Microsoft Intermediate Language (MSIL).
• Microsoft Intermediate Language (MSIL) is a CPU-independent set of instructions that can be efficiently
converted to the native code.

• During the runtime the Common Language Runtime (CLR)'s Just In Time (JIT) compiler converts the Microsoft
Intermediate Language (MSIL) code into native code to the Operating System. • When a compiler produces Microsoft
Intermediate Language (MSIL), it also produces Metadata. The Microsoft Intermediate Language (MSIL) and
Metadata are contained in a portable executable (PE) file.
• Microsoft Intermediate Language (MSIL) includes instructions for loading, storing, initializing, and calling
methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct
memory access, exception handling, and other operations.

• Metadata: Metadata means data about the data. In NET, metadata is the declarative
information which is produced at compile time. It includes all .NET files and assembly. It
allows to load and locate code, enforce code security, generate native code, and provide
reflection at runtime.

1.2 The Common Language(CLR) :-

• .NET CLR is a runtime environment that manages and executes the code written in any .NET
programming language.
• CLR is the virtual machine component of the .NET framework.

• The Common Language Runtime (CLR) 's Just In Time (JIT) compilation converts Intermediate
Language (MSIL) to native code on demand at application run time.
• It also manages the memory and thread at runtime.

• For Example, the VB runtime provided in the earlier versions can execute only VB programs. In
contrast to this, the CLR can execute programs written in any language.

• Presently, the languages for the CLR are VB, C#, and C++ with managed extensions. • The code that is

developed with a language compiler that targets the CLR is called managed code. • On the other hand,
the code that is developed without considering the conventions and requirements of the common
language runtime is called unmanaged code.

• Unmanaged code executes in the common language runtime environment with minimal services. For
example, unmanaged code may run with limited debugging and without the garbage collection process.

pg. 6
❖ Purpose/Role of CLR

Security Engine: This enforces security restrictions and CAS. ∙ Type Checker: This enforces
strict type checking.

∙ Thread Support: This provides multithreading support to applications. ∙ Exception


Manager : This provides a mechanism to handle the run-time exceptions.

∙ Debug Engine : Allow you to debug different type of applications. ∙ COM marshaler : This
allows .net application to exchange data with COM applications.

∙ BASE Class library : This provides the types the applications needed at runtime

1.3. The .net framework class library :-

• Class library is the second major entity of the .NET Framework which is designed to integrate with the
common language runtime.
• It gives the program access to runtime environment.

• It consists of lots of prewritten code that all the applications created in VB .NET and Visual Studio
.NET will use it.
• The code for all the elements like forms, controls and the rest in VB .NET applications actually comes
from the class library.
• It is built on the object-oriented nature of the runtime.

• It 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.

pg. 7
1.3.1 Namespaces :-

• Namespaces help you to create logical groups of related classes and interfaces that can be used by any
language targeting the .NET framework.
• Namespaces allow you to organize your classes so that they can be easily accessed in other applications. •
Namespace can also be used to avoid any naming conflicts between classes that have the same names. • For
example you can use two classes with the same name in an application provided they belong to different
namespaces.
• You can access the classes belonging to a namespace by simply importing the into an application.
• The .NET framework uses a dot (.) as a delimiter between classes and namespaces.
• E.g. System. Console represents the Console class of the System namespace.

List some of the namespaces in .NET.


Namespace Use

System.Data Classes used for database operation(ADO.NET).

System.Data.Oraclecli

ent

System.Data.Sqlclient

System.data. OleDb

System.Data.Odbc

System.IO Provides file and data stream i/o.

System.web.Services Web.services includes those classes required for SOAP based XML messaging.

• It describes how types are declared, used and managed. It facilitates cross-language integration, type
safety, and high performance code execution. It is a specification that defines the rules to support
language integration.
• Common Type System (CTS) describes the datatypes that can be used by managed code. •
The CTS defines the predefined data types available in IL so that all languages that target the
.NET Framework can produce compiled code ultimately based on these types. • It provides an
object oriented model & also provides a library that contains primitive data types.
• CTS defines how these types are declared, used and managed in the runtime. It facilitates cross-
language integration, type safety, and high-performance code execution. • CTS deals with the data
type. So here we have several languages and each and every language has its own data type and one
language data type cannot be understandable by other languages but .NET Framework language
can understand all the data types.

• For example, C# has an int data type and VB.NET has Integer data type. Hence a variable
declared as an int in C# and Integer in VB.NET, finally after compilation, uses the same
structure Int32 from CTS.

pg. 8
The common type system performs the following functions:-

1. It enables cross-language integration, type safety, and high-performance code execution.

2. It provides an object-oriented model for the implementation of many programming languages.

3. It defines rules that every language must follow which runs under .NET FRAMEWORK It
ensures that objects written in different .NET languages like C#, VB.NET, F# etc. can interact with
each other.

pg. 9

You might also like