The ".NET" platform presented by the "Microsoft" company is similar to the COM (Component Object Model) technology that existed before it, it's an easier and more advanced version. This platform was developed for the first release in 2002, with the C# language.
COM technology allowed the writing of cross-language integrable software modules and services in the Windows operating system family.
The COM protocol, originally developed so that a code module written in one programming language can be reused in another, allows the writing of reusable code between programming languages. The goal was to reuse an algorithm written in another programming language. Since codes written in programming languages are ultimately converted to bits, "COM" implemented this protocol to provide cross-language integration for the Microsoft Windows family of operating systems. However, some shortcomings of the "COM" technology led to the creation of its more advanced counterpart, the ".NET" platform.
"COM" technology had the following difficulties,
- It wasn't easy to write programs with COM
- Only the Microsoft Windows operating system family was intended.
- To reuse COM DLLs, it was necessary to register them in the operating system registry.
Although at that time, the rival company "OMG" created the "CORBA" protocol, which was used in several operating systems, the "COM" developed by Microsoft was still widely used. "CORBA" - unlike "COM" was not dependent on the language and also was not dependent on the platform.
The ".NET" platform, which began to be developed at the end of the 90s, has the following advantages,
- It does not depend on the operating system and specific devices
- Provides perfect cross-language integration. So, for example, a DLL written in Visual Basic can easily be used in another ".NET" programming language, and even a class created in one language can generate a class created in another language.
- It supports several programming languages. NET allowed every programmer to choose the language according to his taste. Complete list of languages: list of languages
- Since the main kernel programming language of .NET is the "IL" language, in fact, all the languages on the surface act as a wrapped variant of the "IL" language. In other words, all ".NET" programming languages can create a connection easily because they are converted to the "IL" language.
- It is possible to work comfortably with "COM", considered old technology.
- Assembly files such as "COM" must not be registered in the registry. Because while the operating system performs the hosting of the modules written with the "COM" technology, the hosting of the assembly files written in the ".NET" language is performed by the ".NET" platform.
Programs written on the .NET platform (regardless of their extension) are called assembly files. Whether it is *.dll or *.exe, both are called assembly files. Assembly file hosting is done by CLR (Common language runtime). The mechanism is that when we create any app in .NET, as soon as we start the program, the operating system calls mscoree.dll (Microsoft .NET runtime Execution engine), which in turn creates the CLR environment in . NET. The CLR controls the program we developed. In other words, the CLR provides critical processes such as the memory requirement of the program, finding the files we reference, and exception handling. When the program enters the CLR environment, it is converted to IL (Microsoft intermediate language) during compilation. The IL language is a processor-independent switch language. On the ".NET" platform, it is accepted as a native language. The program converted into IL language is then converted into machine language at runtime through the JIT (Just in Time) compiler, which leads to the execution of the code by the processor.
In .NET, as a final result, we get an Assembly file, which in turn consists of the following parts,
- IL codes - IL codes are descriptions of all assembly files in the internal ".NET" language.
- Using the Manifest - Manifest account, we can see which resources (assembly files) our assembly file references and the copyright settings of the program.
- Metadata - stores all information about all the classes, methods, their input and output parameters, variables, etc., that make up the program.