.Net Framework ArchitectureWhat is .Net framework?When was the .net announced?When was the first version of .net released?What platform does the .net framework runs on?What .Net represents?Different types of DOTNET Frameworks?What is not .NET?What is exactly .NET?What are the different versions of .Net framework?What is CLR (Common language runtime)?What is CTS?What is CLS?What is Managed and unmanaged Code?What is Intermediate Language or MSIL?.NET CoreWhat is .NET Core, and what are its key features?What are the advantages of using .NET Core over the traditional .NET Framework?Explain the concept of cross-platform development in .NET Core.What is ASP.NET Core, and how is it different from ASP.NET?How does Dependency Injection work in .NET Core, and why is it important?What are Middleware and how are they used in ASP.NET Core?What is the role of the .NET CLI (Command-Line Interface) in .NET Core development?Explain the use of the appsettings.json file in ASP.NET Core.What are Tag Helpers in ASP.NET Core MVC?How does .NET Core handle configuration management?What is Entity Framework Core, and how is it different from Entity Framework?Discuss the differences between .NET Core, .NET Framework, and .NET Standard.What is the role of Kestrel in ASP.NET Core?Explain the concept of Razor Pages in ASP.NET Core.How do you handle authentication and authorization in ASP.NET Core?What are the different types of caching in ASP.NET Core?What is the purpose of the Startup class in ASP.NET Core?Explain the importance of the Program.cs file in a .NET Core applicationWhat are the benefits of using the .NET Core CLI (dotnet) for project management?How can you deploy a .NET Core application on different platforms?Discuss the role of Controllers and Views in ASP.NET Core MVC.What are the different types of hosting models in ASP.NET Core?How do you manage application logging in ASP.NET Core?What is the purpose of the app.UseExceptionHandler middleware in ASP.NET Core?How does .NET Core handle Dependency Injection in unit testing?What is the role of the services.Add... methods in ConfigureServices method in Startup.cs?Explain the concept of Health Checks in ASP.NET Core.What are the benefits of using the MVC architectural pattern in ASP.NET Core?How do you handle localization and globalization in ASP.NET Core?How does Dependency Injection (DI) enhance the maintainability and testability of .NET Core applications?Explain the concept of Razor Pages and how they fit into the architectural design of ASP.NET Core applications.What are the architectural differences between monolithic and microservices-based applications, and how does .NET Core support both approaches?

What is Managed and unmanaged Code?

Managed Code:

When a developer writes code in .Net using Visual Studio and creates executable or dynamic link libraries (exe/dll) from various applications (such as console, windows application, library project) or web forms (asp.net, asp.net web API, asp.net MVC) using .Net supported programming languages like C# or Vb.Net, all of these applications are executed under the management of the Common Language Runtime (CLR).

This implies that the CLR takes care of managing unused objects, cleaning them up through the garbage collector. Moreover, if one wishes to communicate with an application built in a different programming language, the Common Type System (CTS) ensures compatibility.

For code access security, there is Code Access Security (CAS) to check if the application has the appropriate permissions to execute the code, all of which are overseen by the CLR.

In essence, the CLR is responsible for loading and unloading all applications built using the .Net framework. Please refer to the image provided below for a visual representation.

Code written using the .Net framework and supported programming languages, which runs under the complete control of the Common Language Runtime (CLR), is referred to as "managed code." If the .Net framework or .Net runtime is not installed, these types of code will not be executed. The CLR takes on the responsibility of providing various features and functionalities of .Net to the managed code, including language interoperability, exception handling, automatic memory management, and code access security.

Unmanaged Code:

Let's consider third-party applications like Team Viewer, Microsoft Word, and Microsoft Visio. Unlike .Net applications, these programs are not developed within the .Net environment; instead, they are built using other programming languages like C/C++. When you integrate such executable files into your .Net-based application, they operate independently and are not governed by the Common Language Runtime (CLR). Instead, they function within their respective runtime environments.

Applications like Team Viewer, Microsoft Word, and Microsoft Visio, which are built in languages such as C++ or VB6, operate within their respective runtime environments and are not managed by the Common Language Runtime (CLR) used in .Net applications.

Such code, which doesn't run under the CLR environment, is referred to as "unmanaged code." Unmanaged code, unlike managed code written in .Net, does not benefit from the facilities and features provided by the CLR, such as language interoperability, exception handling, automatic memory management, and code access security.

In summary, when integrating third-party applications built with other languages into a .Net application, it's essential to be aware that they will operate independently in their own runtime environments, and the CLR will not provide any assistance or features to them.