Dot NET Programming
Unit-I
Overview of .net framework:
The .NET Framework is a software development framework developed by Microsoft
that provides a runtime environment and a set of libraries and tools for building and
running applications on Windows operating systems.
The framework supports multiple programming languages, such as C#, F#, and
[Link], and supports a range of application types, including desktop, web, mobile,
cloud, and gaming applications.
Main Components of .NET Framework
Common Language Runtime(CLR) :
o The CLR is the heart of the .NET Framework, acting as a virtual machine
that runs the code and manages various services such as memory
management, security, and thread management. Code that is compiled and
executed within the CLR is called "Managed Code," while code that the CLR
does not manage is known as "Unmanaged Code."
.NET Framework Class Library (FCL):
o The FCL provides a large set of reusable classes and methods for application
development.
o This includes libraries for input/output operations, networking, data access,
UI controls, and more.
Common Language Runtime (CLR):
The Common Language Runtime (CLR) is a component of the Microsoft .NET
Framework that manages the execution of .NET applications. It is responsible for loading and
executing the code written in various .NET programming languages, including C#, [Link],
F#, and others.
Working of CLR
1. Compilation and Execution:
When we write a C# program, it gets compiled into Intermediate Language
(IL) code, which is platform-independent.
The CLR then uses a Just-In-Time (JIT) compiler to convert the IL code into
machine-specific code while the program runs.
2. Services Provided by CLR:
CLR handles automatic memory management through Garbage Collection,
preventing memory leaks.
It ensures that data types are used correctly and safely.
The CLR checks the IL code for security risks before running it.
3. Cross-Language Integration:
CLR allows code from different .NET languages (C#, [Link], F#) to work together
seamlessly through the Common Type System (CTS).
Framework Classes Library (FCL):
The Framework Class Library or FCL provides the system functionality in the .NET
Framework as it has various classes, data types, interfaces, etc. to perform multiple
functions and build different types of applications such as desktop applications, web
applications, mobile applications, etc.
The Framework Class Library is integrated with the Common Language Runtime
(CLR) of the .NET framework and is used by all the .NET languages such as C#, F#,
Visual Basic .NET, etc.
Categories in the Framework Class Library
The functionality of the Framework Class Library can be broadly divided into three
categories i.e utility features written in .NET, wrappers around the OS functionality and
frameworks. These categories are not rigidly defined and there are many classes that may fit
into more than one category.
Utility Features: The utility features in the FCL includes various collection classes such
as list, stack, queue, dictionary, etc. and also classes for more varied manipulations such as
Regex class for regular expressions.
Wrappers around OS functionality: Some of the features in the FCL are wrappers
around the underlying Windows OS functionality. These include the classes for using the file
system, the classes to handle the network features, the classes to handle I/O for console
applications, etc.
Frameworks: There are various frameworks available in the FCL to develop certain
applications. For example, [Link] is used to develop web applications, Windows
Presentation Foundation (WPF) is used to render user interfaces in Windows applications,
and so on.