Short Overview of .NET

.Net is not a language, it is a framework that provides a library for writing and executing programs at runtime in many programming languages, including Visual C#, Visual Basic, Visual F#, and C++/CLI. The .NET Framework consists of a virtual execution system called CLR and a set of Class Libraries.
We can create or develop Web, Window, and Console applications within the Microsoft Environment.
Net environment
Figure 1: .Net Environment
The following are the benefits of the .NET Framework:
  1. Consistent Programming model: Provides a consistent Object-Oriented Programming model across various programming languages. You can create this model and use it for creating your programs and for other tasks such as connecting to a database, retrieving data from a database, and read and writing files.
  2. Cross-Platform: Any window platform that supports the CLR can execute .Net applications. That means that a .Net application enables interoperability among various Windows operating systems.
  3. Language Interoperability: It specifies that code written in various programming languages can interact with each other in .Net. The CLR has built-in support for language interoperability. For example, in ASP.Net code written in Visual Basic, then also we can inherit a C# class in the application. For this functionality of multi-language code, we need to define a Common Language Specification (CLS) class in the application.
  4. Automatic Management of Resources: It solves the problem of freeing up resources (where resources are files, database connections, memory, and network). When using .Net you really need not worry about resources. The .Net Framework provides a feature called CLR that automatically tracks the resources and frees up the resources when not in use. We don't need to do it manually.

.NET Framework Architecture

Dot Net Framework Architecture
Figure 2: .Net Framework Architecture
  1. .Net Languages: .Net is used in more than 60 languages. I don't have the list but if you want the list I can show you the links in the Comments. Ask me there.
  2. Common Language Runtime (CLR): .Net has the CLR that is the engine that executes all .Net programs and applications and provides all automatic services for these applications such as security, checking things, Memory Management, and Exception Handling.
  3. Common Language Specification (CLS): It describes the rules to support Language Integration. Any program written in a .NET compliant language can interoperate with each other. The CLS specifies an agreement among language designers and class library designers to use common fundamental language features that must be followed by all languages.
  4. Common Type System (CTS): It defines how types are declared, used, and managed at runtime. They define the rules for data types such as strings, numbers and arrays that are shared in all .NET languages.
    For example, assume that in VB we have an INTEGER and in C++ we have a LONG so that in one case they are not compatible with each other. At that time the CTS solves the problem using SYSTEM 32.
  5. Active Server Pages .Net (ASP.Net): This is the engine that hosts the web application that you create within .NET and supports nearly any feature from the .NET class library. ASP.NET also includes a set of web-specific services like secure Authentication and Data Storage.
  6. Visual Studio: This is your Integrated Development Environment (IDE). Visual Studio is a development tool containing a rich set of productivity and debugging features.
The CLR provides the following functionalities:
  1. Class Loader: Loads the classes of a .NET language in the runtime.
  2. JIT Compiler: Specifies a compiler that converts MSIL code into native code.
  3. Code Manager: Manages the resources that are required by the code during execution.
  4. Garbage Collector: Provides automatic memory management and resolves the issues of memory leaks and invalid memory references.
  5. Security Engine: Enforces security restrictions to a .NET code that is determined by Code Access Security (CAS) when calling the code by external code.
  6. Type Checker: It does type checking of any .NET application.
  7. Thread Execution Support: It provides the multithreading for .Net applications.
  8. Base Class Library: It supports the class library that provides data types to .NET applications and programs at runtime.
  9. Exception Handling: It also supports exception handling at runtime.
  10. Debugger: It supports the debug engine that debugs various types of applications.
I hope you like this. I'll show you more on this topic in my next chapter on .Net. Have a good day! Thank you for reading.