0% found this document useful (0 votes)
38 views29 pages

Enterprise System Course Code SI-342

Microsoft was founded in 1975 and gained prominence with the launch of MS-DOS in 1981, followed by Windows operating systems. The introduction of the .NET Framework in 2000 marked a significant shift towards a unified development platform, evolving through various versions and supporting multiple programming languages. Key components like the Common Language Runtime (CLR), Base Class Library (BCL), and Common Type System (CTS) ensure interoperability and efficiency across applications developed within the .NET ecosystem.

Uploaded by

manahilsohail645
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)
38 views29 pages

Enterprise System Course Code SI-342

Microsoft was founded in 1975 and gained prominence with the launch of MS-DOS in 1981, followed by Windows operating systems. The introduction of the .NET Framework in 2000 marked a significant shift towards a unified development platform, evolving through various versions and supporting multiple programming languages. Key components like the Common Language Runtime (CLR), Base Class Library (BCL), and Common Type System (CTS) ensure interoperability and efficiency across applications developed within the .NET ecosystem.

Uploaded by

manahilsohail645
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

Microsoft Technology History

 Early Beginnings
 1975: Microsoft was founded by Bill Gates and Paul
Allen. Their first project was developing a BASIC
interpreter for the Altair 8800 microcomputer.
 MS-DOS and Early Operating Systems
 1981: Microsoft launched MS-DOS (Microsoft Disk
Operating System), which became the primary
operating system for IBM personal computers.
 1985: Windows 1.0 was launched, a graphical user
interface (GUI) that ran on top of MS-DOS.
 Advancement in Windows Operating System
 1990: Windows 3.0 was released, becoming the
first widely successful version of Windows with
an improved GUI and better memory
management.
 1995: Windows 95 was launched, introducing
significant features like the Start menu and
taskbar, and fully integrated internet support
via Internet Explorer.
Introduction of Development Tools
1991: Microsoft launched Visual Basic, an event-
driven programming language used for rapid
application development (RAD).
1993: Visual C++ was released, a comprehensive
integrated development environment (IDE) for
C++ development.
Transition to .NET Framework
 2000: Microsoft announced the .NET
Framework, marking a major shift towards a
unified platform for development.
 2002: .NET Framework 1.0 was released,
featuring the Common Language Runtime (CLR),
base class library, ASP.NET (web development
framework), and ADO.NET (data access
framework).
Evolution of .NET Framework
 2003: .NET Framework 1.1 was released with
improved support and features.
 2005: .NET Framework 2.0 was launched,
introducing generics and enhancements to
ASP.NET 2.0.
 2008: .NET Framework 3.5 was released,
including Language Integrated Query (LINQ) and
ASP.NET AJAX support.
 2010: .NET Framework 4.0 was released,
featuring parallel programming and improved
CLR features.
Modern Developments
 2012: Microsoft released .NET Framework 4.5, which
included async programming and an improved
networking stack.
 2014: .NET Core was announced, a cross-platform,
open-source version of the .NET Framework.
 2016: .NET Core 1.0 was released, capable of running
on Windows, macOS, and Linux platforms.
Unified Platform
 2020: Microsoft released .NET 5, unifying .NET Core and
.NET Framework into a single platform, providing a
simplified and cross-platform development experience.
Introduction to .NET Framework
.NET is a versatile software framework
developed by Microsoft that helps developers
build various types of applications across
platforms, including Windows, macOS, and
Linux. It supports the development of:
•Web Applications
•Desktop Applications
•Mobile Apps
•Cloud-Based Services
•Games
1. Common Language Runtime (CLR)
The Common Language Runtime (CLR) is the core of the .NET framework.
It serves as the execution engine that runs .NET applications and provides
essential services:
Execution Engine: The CLR is responsible for executing .NET programs,
ensuring that code runs correctly on the underlying hardware.
Memory Management: The CLR allocates and deallocates memory,
handling object creation and freeing up memory when objects are no
longer needed, optimizing system performance.
Garbage Collection: It automatically removes objects from memory that
are no longer in use, enhancing application efficiency and speed.
Exception Handling: CLR offers structured exception handling to manage
runtime errors gracefully without crashing the application.
CIL to Machine Code Conversion: After compilation, .NET code is
converted to Common Intermediate Language (CIL). The CLR then
converts CIL into machine code, allowing the application to run on the
operating system.
2. Base Class Library (BCL)
The Base Class Library (BCL) is a collection of reusable classes
and functions that provide a foundation for .NET applications:
Reusable Classes and Functions: The BCL offers pre-written code
that developers can directly use, like data types, file handling,
and input/output operations.
Common Functionalities: It includes utilities for string
manipulation, file I/O, database connectivity, XML parsing, and
networking, reducing the need to write new code for common
tasks.
Foundation for .NET Applications: The BCL is essential for every
.NET application as it provides the core tools and classes
required for development.
3. Supported Languages
One of the strengths of .NET is its support for multiple
programming languages:
Multiple Language Support: You can use languages like
C#, VB.NET, and F# in .NET, giving flexibility to choose the
language best suited for your project.
CIL Compilation: Regardless of the language used, code is
compiled into platform-independent CIL, which the CLR
executes on any supported operating system.
Language Interoperability: .NET allows you to mix and
match languages within a project, enabling seamless
integration of C# classes in a VB.NET project and vice
versa.
4. Application Models in .NET
.NET supports a wide range of application models:
ASP.NET Core: A cross-platform framework for building high-
performance web applications and APIs, ideal for cloud-based
solutions.
Entity Framework Core: An Object-Relational Mapper (ORM) that
simplifies database operations, reducing the need for writing SQL
queries.
Xamarin: A tool for building native mobile applications for
Android, iOS, and Windows using a single codebase.
Windows Forms/WPF: These are used for desktop applications.
Windows Forms is suitable for simple desktop apps, while
Windows Presentation Foundation (WPF) offers advanced
features like 3D graphics and animations.
5. Cross-Platform Support
.NET provides robust cross-platform capabilities:
Multi-OS Compatibility: .NET runs on multiple operating
systems, allowing you to develop applications on one platform
and deploy them on another.
Consistent Development Experience: Whether building a web
app on Linux or a desktop app on Windows, the development
tools and libraries remain consistent.
Cross-Platform Libraries: Libraries like the BCL, ASP.NET Core,
and Entity Framework Core are available across all supported
platforms.
Docker Support: .NET integrates with Docker, enabling the
deployment of applications in lightweight containers across
various environments, whether on-premises, cloud, or hybrid
setups.
MSIL (Microsoft Intermediate
Language) in .NET Framework
Introduction to MSIL:
 MSIL stands for Microsoft Intermediate Language and
is also known as IL (Intermediate Language) or CIL
(Common Intermediate Language).
 It is a low-level, platform-independent language used
in the .NET framework for code execution.
 When you write code in languages like C#, VB.NET, or
any .NET-supported language and compile it, the code
is converted to MSIL.
Role of MSIL in .NET Framework:
1.Platform Independence:
1. MSIL is platform-independent, meaning it doesn’t run directly on
a specific operating system or hardware.
2. The same MSIL code can run on multiple platforms (e.g.,
Windows, Linux) as long as the platform has a Common
Language Runtime (CLR) available.
2.Language Interoperability:
1. .NET framework supports multiple programming languages like
C#, VB.NET, and F#.
2. Code from these languages is compiled into MSIL, allowing
different language codes to interact.
3. Example: Code written in C# can be used in a VB.NET project.
3.JIT Compilation:
1. MSIL code is not executed directly. During runtime, the CLR
converts MSIL to native machine code using a Just-In-Time (JIT)
compiler.
2. This native code is then executed by the CPU, optimizing the
application's performance.
Key Features of MSIL:
1.Rich Instruction Set:
1. MSIL provides a comprehensive instruction set that represents
high-level programming constructs like loops, branches, arithmetic
operations, and memory access.
2. This makes the .NET framework a powerful execution environment
for strongly-typed languages.
2.Security:
1. During execution, the CLR performs code verification to ensure the
security of MSIL.
2. It checks whether the MSIL code is type-safe and only accesses
authorized memory areas, preventing vulnerabilities like buffer
overflows.
3.Exception Handling:
1. MSIL includes built-in support for exception handling, enabling
efficient error management in .NET applications.
MSIL Execution Process:
Source Code to MSIL:
When you write source code in a .NET language and compile it,
the compiler converts the code into MSIL.
Example:
C# code Console.WriteLine("Hello, World!"); converts to MSIL
like:
ldstr "Hello, World!"
call void [mscorlib]System.Console::WriteLine(string)
MSIL to Native Code:
When the application runs, the CLR uses JIT compilation to
convert MSIL into native machine code, which the CPU
executes directly.
Execution: After the native code is executed, the application
produces its output, such as printing "Hello, World!" on the
console.
CLS (Common Language Specification) in .NET
Framework
Introduction to CLS:
 CLS stands for Common Language Specification and is a
key component of the .NET framework that ensures
interoperability across different programming languages.
 It defines a set of basic rules that all .NET languages must
follow to be compatible with one another.
 Understanding CLS is crucial for working with .NET
architecture, as it allows code written in multiple
languages to integrate smoothly.
Role of CLS in .NET Framework:
1.Language Interoperability:
1. .NET supports multiple languages like C#, VB.NET, and F#, each
with its own syntax and features.
2. CLS ensures that code can be exchanged between these
languages without compatibility issues. For example, a library
written in C# can be used in VB.NET or F# as long as it follows
CLS rules.
2.Common Set of Features:
1. CLS defines a common set of features that must be available in
all .NET languages.
2. If your code is CLS-compliant, it can be used across any CLS-
compliant language, ensuring smooth integration.
3.Ensuring Compatibility:
1. When developing across multiple languages or sharing code,
writing CLS-compliant code is essential.
2. CLS guarantees that your code will be compatible with other
languages within the .NET ecosystem.
Key Features and Rules of CLS:
 Data Types Compatibility:
 CLS defines a set of data types (e.g., int, float, double, bool) that must be supported
across all .NET languages, ensuring consistency.
 Method Signatures:
 CLS enforces simple and consistent method signatures. Method overloads should
differ not only in return type but also in the type and number of parameters.
 Case Sensitivity:
 CLS recommends that public identifiers (e.g., method names, variable names) be
case-insensitive, meaning myMethod and MyMethod should not be treated as
different. This is crucial for languages that are case-insensitive.
 No Unsigned Types in Public APIs:

 CLS does not allow unsigned types (e.g., uint, ulong) in public APIs because not all
.NET languages support them. For interoperability, it’s better to use CLS-compliant
types like int and long.
 Exceptions:

 CLS ensures that exceptions thrown must inherit from the System.Exception class,
allowing consistent error handling across languages.
CLS Compliance:

Code that adheres to these rules is considered CLS-compliant.


To ensure CLS compliance, avoid using language-specific features not supported by
other languages and design public APIs that are compatible across all .NET languages.
Examples:

CLS-Compliant Code:

public class Example


{
public int Add(int a, int b)
{
return a + b;
}
}
This method is CLS-compliant because it uses standard data types (int) and has a
simple method signature.
Non-CLS-Compliant Code:

public class Example


{
public uint Add(uint a, uint b)
{
return a + b;
}
}
This method is non-CLS-compliant because it uses uint (an unsigned
integer), which is not supported by all .NET languages.
CTS (Common Type System) in .NET Framework
Introduction: The Common Type System (CTS) is a crucial
component of the .NET framework that ensures interoperability
and compatibility between different programming languages. The
primary objective of CTS is to maintain consistency across all .NET
languages, enabling them to seamlessly interact with each other.
What is CTS (Common Type System)?
CTS is a specification that defines how types are declared, used,
and managed in the .NET framework. It establishes a standard
that every .NET language must follow for declaring and using
types. The core aim of CTS is to allow different languages to
represent their unique types in a common framework.
Role of CTS in .NET Framework
Type Compatibility:
CTS ensures that all types across .NET languages follow a common
standard. This means a type defined in one language can be used in
another language without requiring conversion or encountering
compatibility issues.
Language Interoperability:
CTS ensures that code written in different languages can interact
smoothly. For instance, if you define a class in C#, it will be
accessible in VB.NET or F# because all these languages adhere to
CTS standard types.
Type Safety:
CTS promotes type safety, ensuring that data conversion between
types does not lead to any loss of integrity. This means operations
applied to a data type are consistent and appropriate for that type.
Components of CTS
CTS has two main components: Value Types and Reference Types.
Understanding these is a core aspect of CTS.
Value Types:
Definition: Value types store their data directly in memory
(stack).
Examples: int, float, bool, char, structs.
Characteristics: When value types are copied, their actual
values are copied, leading to separate memory locations for
each variable.
Reference Types:
Definition: Reference types store references to their data,
which is stored in heap memory.
Examples: class, interface, delegate, arrays, string.
Characteristics: When reference types are copied, only the
reference is copied, meaning both variables point to the same
memory location.
Common Types in CTS
 An important aspect of CTS is that it provides
common types that are consistent across all .NET
languages, ensuring interoperability.
 System.Int32: Represents a 32-bit integer in CTS. In
C#, it is called int, while in VB.NET, it is known as
Integer. CTS ensures consistent behavior across both
languages.
 System.String: Represents a string type in CTS, which
is a reference type and behaves the same in all .NET
languages.
Type Conversion in CTS
CTS supports two types of type conversion:
Implicit Conversion:
Automatic conversion between compatible types, like
converting an int to a long.
Example:
int num = 10;
long bigNum = num; // Implicit conversion
Explicit Conversion:
Manual casting is required for converting between types that
are not automatically compatible, like converting a double to an
int.
Example:
double num = 9.8;
int wholeNum = (int)num; // Explicit conversion
CTS Compliance
A language that follows CTS rules within the .NET framework is
called CTS-compliant. CTS compliance means the types used in
your code are compatible across all .NET languages.
Example:
CTS-compliant Code:
int num = 10; // System.Int32 in CTS string text = "Hello"; //
System.String in CTS
These types are available in C#, VB.NET, and F#, ensuring
compatibility across all languages.
Non-CTS-compliant Code: If a language introduces custom types
or data structures that do not align with CTS standards, those
types may not be accessible in other languages.

You might also like