C# - Ultimate Guide - Beginner to Advanced | Master class
Section 1 - Course Fundamentals
Understanding .NET Framework
What is .NET?
• Application Development Platform, to build Desktop, Web and Mobile Apps.
• Developed by Microsoft, in 2002.
• Provides fully managed, secured application execution environment.
• Supports multiple languages such as C#, VB, VC++ etc.
Modules & Apps
ASP.Net
WebSites
Web Applications
WebServices
C#.Net
Windows GUI Applications
Windows Services
Console Applications
Common Language Infrastructure (CLI)
Common Language Runtime (CLR)
1. "Execution Engine" for all .net languages.
2. Code-Execution Environment that executes all types of .net applications.
3. Applications developed in any .net language runs based on "CLR" only.
4. CLR is a part of .NET Framework; pre-installed in Windows.
CLR Components:
• Class Loader
• Memory Manager
• Garbage Collector
• JIT Compiler
• Exception Manager
• Thread Manager
• Security Manager
Components of CLR
Class Loader:
Loading classes from compiled source code to memory.
Loads a class, when it is needed (before creating object).
Memory Manager:
Allocating necessary memory for objects.
When an object is created in the code, certain amount of memory will be allocated for the object in
application's "heap".
Garbage Collector:
Freeing (deleting) memory of objects.
Identifies all unreferenced objects and delete them in memory (RAM).
JIT (Just-In-Time) Compiler:
Convert the MSIL Code into Native Machine Language.
Compiles the code of a class, when it is needed (before executing that particular class).
Exception Manager:
Raise notifications while run-time errors.
Creates exception logs.
Thread Manager:
Create threads (background process) to execute the code.
The entire program is treated as "Main thread".
Developer can create sub threads (child threads) to do background processes.
Security Manager:
Verifies whether the application has permission to access system resources or not.
Before executing the application, it verifies whether the application has not attacked by malicious
programs & has necessary permissions to access files / folders and hardware resources.
.NET Framework
.NET Framework Architecture
Base Class Library (BCL)
Contains a set of pre-defined classes that can be used in all types of .net applications & languages for
general I/O operations, type conversion, creation of threads etc.
Eg:
• Console
• String
• StringBuilder
• Convert
• Thread
• Task
etc.
ADO.NET
Contains a set of pre-defined classes that can be used in all types of .net applications & languages for
connecting to databases, retrieving data from databases, inserting, updating, deleting rows etc.
Eg:
• SqlConnection
• SqlCommand
• SqlDataAdapter
• SqlDataReader
etc.
WinForms
Contains a set of pre-defined classes that can be used in Windows GUI applications for development
of GUI elements such as form, textbox, button, checkbox, radio button, dropdownlist etc.
Eg:
• Form
• Label
• Button
• Text Box
etc.
Windows Presentation Foundation (WPF)
Contains a set of pre-defined classes that can be used in Rich Windows GUI applications for
development of GUI elements such as window, textbox, button, checkbox, radio button,
dropdownlist etc.
Eg:
• Window
• Label
• Button
• Text Box
etc.
Active Server Pages (ASP.NET)
Contains a set of pre-defined classes that can be used in Web Applications for development of GUI
elements such as page, textbox, button, checkbox, radio button, dropdownlist etc.
Eg:
• Page
• Label
• Button
• Text Box
etc.
Common Language Specification (CLS)
Contains a set of rules (concepts) that are common to all .net languages such as C#.NET, VB.NET etc.
Common rules of CLS:
• CTS (Common Type System): Contains data types such as Int32, Int64, Single, Double etc.
• Classes & Objects
• Reference Variables
• Method Parameters
• Generics
etc.
Versions of .NET Framework
.NET 1.0 New Features
1. Data Types
2. Classes
3. Objects
4. Arrays
5. Collections
6. All other basic language features.
.NET 1.1 New Features
1. Code Access Security in ASP.NET applications
2. ODBC (Open Database Connection)
3. .NET Compact Framework to run .net apps on small devices
.NET 2.0 New Features
1. 64-bit system execution support
2. Themes, Skins, MasterPages and WebParts, Membership in ASP.NET
3. Partial Classes, Nullable Types, Anonymous Methods, Iterators, Generics in C#
4. CLR 2.0
.NET 3.0 New Features
1. WPF (Windows Presentation Foundation): Framework to develop rich Windows GUI Apps.
2. WCF (Windows Communication Foundation): Framework to develop Service Oriented
Applications (SOA).
3. WWF (Windows Workflow Foundation): Framework to develop task automation and
transactions using workflows.
.NET 3.5 New Features
1. Data Annotations
2. Entity Framework
.NET 4.0 New Features
1. Task Parallel Library (Tasks)
2. Named Parameters in C#
3. CLR 4.0
.NET 4.5 New Features
1. Windows Store Apps
2. Async and Await in C#
3. New input types, Bundling & Minification, Web Sockets, Anti-XSS in ASP.NET
.NET 4.6 New Features
1. SHA-2, Elliptic Curve Cryptography API
2. 64-bit JIT compiler for Managed Code
3. Introduction of .NET Core (Provides multi-platform support for Windows, LINUX, Mac,
Android, iOS).
.NET 4.7 New Features
1. Print-API and Stylus support for WPF
2. Introduction of ASP.NET Core (Provides multi-platform support for Windows, LINUX, Mac as
Web Servers).
.NET 4.8 New Features
1. Performance & security updates.
2. Support for high-resolution displays.
.NET Core
• Introduced in 2016.
• Microsoft's Application Development Platform to develop any desktop, web, mobile and
embedded (IoT) applications.
• Supports Windows, LINUX, Mac, Android, iOS, Windows Phone devices.
• Versions: 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1
• Mainly used in Xamarin and ASP.NET Core.
• Open Source (via MIT license)
• Contains the class library, which is a subset of .NET Framework.
• Doesn't contain any Windows-specific classes / run time services.
• C# / VB.NET can used for writing code of .NET Core.
Introducing Visual Studio
IDE / Code editor for all types of .net applications & languages.
Should be installed on 'Developer-machine'.
Features:
• Intelli-sense (code completion)
• Syntax highlighting
• Debugger
• GUI Designer
Versions of Visual Studio