Digital Garden
Computer Science
C#
Building Blocks of C#

Building Blocks of C#

.NET

The key component is the CLR (Common Language Runtime) which contains Exception Handling, Garbage Collection, and compilers that converts the code to CIL (Common Intermediate Language)+metadata which is then used to compile JIT (Just in time), prior to execution to native machine code which makes it cross-platform. .NET emphasizes language interoperability (using multiple Languages like C++ and C# together) and platform independence.

The .Net Framework also includes a set of standard Libraries.

All the codes that is controlled by the CLR is called managed code, while the parts of the program which are written using the unsafe keyword are called unmanaged code. These are beyond the control of the CLR.

Assemblies

Assemblies form the fundamental units of deployment, version control, reuse. Assemblies take the form of executable (.exe) or dynamic link library (.dll) files, and are the building blocks of .NET applications. They contain a Manifest(assembly name, version number list of modules/types), metadata(dynamic loading versioning, reflection) and the CIL Code of each Class.

Namespaces

Namespaces allow for the logical grouping of related types, like packages in Java. And using is like import in Java. A file can declare multiple namespaces. Namespaces and classes are not mapped to directories and files (but recommended).