C# .
Net
Object Oriented Programming Language
Languages
You can write .NET apps in C#, F#, or Visual Basic.
● C# is a simple, modern, object-oriented, and
type-safe programming language.
● F# is a cross-platform, open-source,
functional programming language for .NET. It
also includes object-oriented and imperative
programming.
● Visual Basic is an approachable language
with a simple syntax for building type-safe,
object-oriented apps.
What is .NET Framework?
.NET, .NET Framework, and .NET Core
There are various implementations of .NET. Each implementation allows .NET code
to execute in different places—Linux, macOS, Windows, iOS, Android, and many
more.
1. .NET Framework is the original implementation of .NET. It supports running
websites, services, desktop apps, and more on Windows.
2. .NET Core is a cross-platform implementation for running websites, services,
and console apps on Windows, Linux, and macOS. .NET Core is open source
on GitHub.
Architecture of .NET Framework
The two major components of .NET Framework are the Common Language
Runtime and the .NET Framework Class Library.
● The Common Language Runtime (CLR) is the execution engine that handles
running applications. It provides services like thread management, garbage
collection, type-safety, exception handling, and more.
● The Class Library provides a set of APIs and types for common functionality.
It provides types for strings, dates, numbers, etc. The Class Library includes
APIs for reading and writing files, connecting to databases, drawing, and
more.
Architecture
of .NET Framework
What is CLS and CTS ?
CTS and CLS are parts of .NET CLR and are responsible for
type safety within the code. Both allow cross-language
communication and type safety. In this article, I would like to
expose the relationship between these two.
CLS - (Common Language Specification)
CLS stands for Common Language Specification and it is a subset of CTS. It defines a set of
rules and restrictions that every language must follow which runs under the .NET framework.
The languages which follow these set of rules are said to be CLS Compliant. In simple
words, CLS enables cross-language integration or Interoperability.
For Example
1. if we talk about C# and VB.NET then, in C# every statement must have to end with a
semicolon. it is also called a statement Terminator, but in VB.NET each statement
should not end with a semicolon(;).
CTS - (Common Type System)
Common Type System (CTS) describes the datatypes that can be used by managed code.
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. The rules
defined in CTS can be used to define your own classes and values.
OR we can also understand like,
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.
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.
BCL Basic Class Library
The Base Class Library (BCL) is literally that, the base. It contains basic, fundamental
types like System.String and System.DateTime.
FCL - Framework Class Library
The Framework Class Library (FCL) is the wider library that contains the totality:
ASP.NET, WinForms, the XML stack, ADO.NET and more.
Cross Platform
Whether you're working in C#, F#, or Visual
Basic, your code will run natively on any
compatible OS. Different .NET implementations
handle the heavy lifting for you:
● .NET Core is a cross-platform .NET implementation for
websites, servers, and console apps on Windows, Linux,
and macOS.
● .NET Framework supports websites, services, desktop
apps, and more on Windows.
● Xamarin/Mono is a .NET implementation for running
apps on all the major mobile operating systems.
Libraries
To extend functionality, Microsoft and
others maintain a healthy package
ecosystem built on .NET Standard.
NuGet is a package manager built
specifically for .NET that contains over
90,000 packages.
Metadata,Manifest,Assembly
Metadata is machine-readable information about a resource, or “data about data.” Such information might
include details on content, format, size, or other characteristics of a data source. In .NET, metadata includes
type definitions, version information, external assembly references, and other standardized information.
Manifest is nothing but a simple text file used to store metadata information of different .NET assemblies.
Manifest file can be saved as a stand alone file of type PE. It can also be stored as an exe or as a dll file
containing intermediate language code.
Assembly is the smallest unit of deployment of a .net application. It can be a dll or an exe.
A .NET program consists of one or more assemblies.
Introduction to C#
C# is a strongly typed object-oriented programming language. C# is open source, simple, modern,
flexible, and versatile. In this article, let’s learn what C# is, what C# can do, and how C# is different
than C++ and other programming languages.
A programming language on computer science is a language that is used to write software programs.
C# is a programming language developed and launched by Microsoft in 2001. C# is a simple,
modern, and object-oriented language that provides modern day developers flexibility and features to
build software that will not only work today but will be applicable for years in the future.
C# is modern and easy
C# is a simple, modern, and an object-oriented programming language. The
purpose of C# was to develop a programming language that is not only easy to
learn but also supports modern day functionality for all kind of software
development.
C# is fast and open source
C# is open source under the .NET Foundation, which is governed and run
independently of Microsoft. C# language specifications, compilers, and related
tools are open source projects on Github. While C# language feature design is
lead by Microsoft, the open source community is very active in the language
development and improvements.
C# is fast compare to several other high-level programming languages. C# 8 has
many performance improvements.
C# is cross platform
C# is cross platform programming language. You can build .NET applications that
can be deployed on Windows, Linux, and Mac platforms. C# apps can also be
deployed in cloud and containers.
Elvin Camalzade