Introduction of .Net Framework - Chapter1
Introduction of .Net Framework - Chapter1
of Computing
Web Application Development using Visual Studio
&
22CAH-301/22SCH-301
Career
Web Development
Planning 1
Syllabus
• Unit-1 :Overview of .Net Framework
• NET Framework Introduction: Overview, Framework Components,
Framework Versions, Types of Applications which can be developed using
MS.NET ,MS.NET Base Class Library,MS.NET Namespaces ,MSIL /
Metadata and PE files, The Common Language Runtime (CLR), Managed
Code ,MS.NET Memory Management / Garbage Collection, Common Type
System (CTS) ,Common Language Specification (CLS) ,Types of JIT
Compilers, Security Manager. VS.NET and C, Introduction to Project and
Solution in Studio, Command Line Arguments, Global, Boxing and Unboxing,
Pass by value and by reference and out parameter, Array Lists & Hash
Tables, Generic Collections.
2
• .Net Assembly: Classification of Assembly, Creating and using Managed
DLLs, Private Assembly and Shared Assembly, The Global Assembly Cache,
Property. Procedures.
• File Handling: File Handling: System.IO Namespace, working with
Directories and Files.
3
Web Application •Introduction: Overview of components,
Development using FCL
,BCL
Visual Studio
•.NET Framework Architecture: CLR,
Course Outcomes CTS, Garbage collection
CO Title Level
Number •Overview of Class library, File Libraries
CO1 Able to understand .NET framework, its features Remember and Directories.
and various objects of ASP.Net.
4
.NET Framework
6
Key Components of .NET Framework
7
Continue…..
• Windows Forms:
• Windows Forms is a GUI class library within the .NET Framework used to create rich desktop applications.
• ADO.NET:
• ADO.NET is a data access technology in the .NET Framework, providing communication between relational and non-relational systems
through a common set of components.
8
.NET Framework Components
• CLR(Common Language Runtime)
• CLS(Common Language
Specification)
• CTS(Common Type System)
• BCL(Base Class Library)
FIGURE 1.4(Components)[3]
9
Types of Applications which can be developed
using MS.NET :
1. Web Applications
• ASP.NET Web Forms: Allows for the creation of dynamic and data-driven web pages with a rich user interface.
• ASP.NET MVC: A framework for building scalable and maintainable web applications using the Model-View-Controller design
pattern.
• ASP.NET Core: A cross-platform, high-performance framework for building modern, cloud-based, and internet-connected
applications, including web APIs.
2. Desktop Applications
• Windows Forms: A UI framework for building Windows desktop applications with a rich user interface.
• WPF (Windows Presentation Foundation): Used for developing visually appealing and feature-rich Windows desktop
applications with advanced graphics, layout, and animation capabilities.
• UWP (Universal Windows Platform): Enables developers to create applications that can run on any Windows 10 device,
including PCs, tablets, smartphones, and IoT devices.
3. Mobile Applications
• Xamarin: A framework that allows developers to build native Android, iOS, and Windows apps using a single shared codebase
written in C#.
4. Cloud Applications
• Azure Services: With .NET, developers can build scalable and resilient cloud applications using Microsoft Azure, leveraging
services like Azure Functions, App Services, and various other cloud-based services.
10
Namespace:
• Namespaces in the .NET Framework organize large libraries into logical groupings,
making it easier to find and use the classes, interfaces, and methods required for
application development. Here are some of the most commonly used namespaces in
MS.NET:
• System
• The root namespace containing fundamental classes and base classes for
the .NET Framework.
• Examples: System.String, System.Math, System.Console
• System.Collections
• Contains interfaces and classes that define various collections of objects.
• Examples: System.Collections.ArrayList, System.Collections.Hashtable
11
• System.IO
• Contains types that allow reading and writing to files and data streams,
and types that provide basic file and directory support.
• Examples: System.IO.FileStream, System.IO.StreamReader.
12
Metadata:
• Metadata
• Metadata in .NET provides a comprehensive description of the types, members, and references in
your code. It is essential for the CLR (Common Language Runtime) to manage code execution and
provides important services such as type checking, security enforcement, and garbage collection.
• Key Aspects of Metadata:
• Type Information: Describes the definitions of classes, structs, enums, delegates, and interfaces.
• Class and member names
• Inheritance relationships
• Method signatures
• References: Lists other assemblies that the code depends on.
• Attributes: Custom metadata that can be applied to various code elements (e.g., classes, methods)
to provide additional information or specify behavior.
• Manifest: Contains assembly metadata, including the assembly's identity (name, version, culture,
public key), and information about referenced assemblies and files.
13
Portable Executable (PE) Files
14
CLR:
• The Common Language Runtime (CLR) is the virtual machine component of the .NET Framework
that manages the execution of .NET programs. It provides a range of essential services, such as
memory management, type safety, exception handling, garbage collection, security, and thread
management. Here is an in-depth look at the CLR and its key features:
• Key Features of the CLR
• Memory Management:
• Garbage Collection (GC): The CLR includes a garbage collector that automatically handles
memory allocation and deallocation. The GC tracks objects in memory, identifies those that
are no longer in use, and reclaims their memory, thus preventing memory leaks and
optimizing resource usage.
• Type Safety:
• Type Checking: The CLR ensures that code adheres to the defined type system, which prevents
type errors and enhances security and stability. This includes verifying that objects are used
according to their declared types.
15
Continue…..
• Exception Handling:
• Structured Exception Handling: The CLR provides a consistent model for detecting and responding to
runtime errors through exceptions. This system allows developers to write robust error-handling code and
ensures that exceptions can be propagated across different languages and components within a .NET
application.
• Security:
• Code Access Security (CAS): The CLR enforces security policies that control the permissions granted to
code, based on the identity of the code and other factors. This helps protect the system from potentially
harmful code.
• Verification: The CLR verifies the code to ensure that it adheres to type safety and other rules, which helps
prevent certain types of security vulnerabilities.
16
Managed code
• Managed code refers to code that is executed by the Common Language Runtime (CLR) in the .NET Framework. This code benefits from various
runtime services provided by the CLR, such as memory management, security, exception handling, and more. Here's an in-depth look at managed
code and its implications:
• Execution Under CLR Control:
• Managed code runs under the supervision of the CLR, which provides a managed execution environment. This contrasts with unmanaged
code, which runs directly on the operating system without CLR intervention.
• Memory Management:
• Automatic Memory Management: Managed code benefits from automatic memory management through garbage collection. The CLR’s
garbage collector automatically allocates and releases memory, reducing the likelihood of memory leaks and fragmentation.
• Type Safety:
• Strict Type Enforcement: The CLR enforces strict type safety rules, ensuring that objects are used in accordance with their defined types.
This helps prevent type-related errors and enhances the security and stability of the application.
• Security:
• Code Access Security (CAS): Managed code can be subject to code access security policies, which control the permissions granted to the
code based on its origin and other factors. This helps protect the system from potentially harmful operations.
• Exception Handling:
• Structured Exception Handling: The CLR provides a standardized way to handle exceptions, allowing developers to write robust error-
handling code. Exceptions in managed code can be propagated and handled across different languages and components.
17
CLS :
• The Common Language Specification (CLS) is a crucial component of the .NET Framework, defining a
set of rules and guidelines that any language targeting the Common Language Runtime (CLR) must
adhere to. It ensures interoperability between different languages that compile to the CLR, promoting
code reuse and compatibility.
• Avoiding Language-Specific Features: To promote interoperability, the CLS discourages the use of language-
specific features that may not be universally understood by other languages targeting the CLR. For example, it
recommends avoiding language-specific keywords as identifiers and using only data types that are part of the
CLS.
• Backward Compatibility: While the CLS encourages interoperability, it also allows languages to support
additional features beyond the CLS if they choose to do so. However, developers must mark these features
explicitly, and consuming code written in such a language may not be possible from all other .NET languages.
• Promoting Best Practices: The CLS promotes best practices in software development by encouraging developers
to write code that is clear, consistent, and compatible across different languages. This helps maintain a high level
of quality and consistency in the .NET ecosystem.
18
Memory Management/ Garbage collection:
• Memory Management
• Memory management refers to the process of allocating and deallocating memory resources during
the execution of a program. In managed environments like .NET, memory management is handled
automatically by the runtime, alleviating developers from manual memory management tasks.
• Garbage Collection in .NET
• In .NET, the garbage collector (GC) is responsible for automatically reclaiming memory occupied by
objects that are no longer needed. The GC runs in the background and periodically scans the
managed heap to identify and collect garbage.
19
Common Type System (CTS):
• The Common Type System (CTS) is a fundamental component of the .NET
Framework that defines how types are declared, used, and managed in the
runtime environment. It ensures interoperability between different
programming languages supported by .NET and provides a common set of
rules for type declarations and usage across languages.
• Example of CTS in Action:
• Consider a scenario where a C# class defines a method that accepts an
argument of type System.Object. In another part of the application, a Visual
Basic .NET code calls this method and passes an instance of a class defined
in Visual Basic .NET. Despite being written in different languages, the code
interoperates seamlessly because both languages adhere to the rules
defined by CTS.
20
REFERENCES
⮚Programming in C# Concepts by Peterson, J.L. & Silberschatz, A. Addison Wesley,
New Delhi.
⮚http://nptel.ac.in/courses/106108101/pdf/Lecture_Notes/Mod%202_LN.pdf
⮚https://www.tutorialspoint.com/asp.net/asp.net_introduction.htm
21
REFERENCES
1. https://lh3.googleusercontent.com/proxy/
wERQ7nvZtPV99DWUCtUWFSurRqd8w94Y6G9vwwLS1t2tbOOWjfgoofZhZzfOg
GLuYCvfu9zYtmBVQZStIObO2w3G3YFegHZVLVrM_EpPLt4gsdVNp8Pt6SQTl73
LgEiZbQ
2. https://image.slidesharecdn.com/dotnetfxverhistory-130606005246-phpapp01/95/
dotnet-frameworks-version-history-8-638.jpg?cb=1370480075
3. https://www.guru99.com/images/c-sharp-net/052416_1343_WhatisNETFr1.png
22
THANK YOU