Role of MSCoree.dll in context of ASP.NET in .NET Framework?

bhavna 106 Reputation points
2022-07-02T10:33:54.97+00:00

This question is about .NET Framework and not .NET Core.
When an exe is compiled it generates PE file which has all the information such as which CLR version to load. Does a Web APP also compile to PE file, if not then how does AspNet_Wp get the details also for Desktop/Console app it is MSCoree.dll that loads the CLR, is there no role of MSCoree.dll in a web App?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,274 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,771 Reputation points
    2022-07-02T15:34:09.287+00:00

    No. Web apps compile to a .net dll. The asp.net hosting module create an app domain and loads all the dlls found in the bin folder. Then it uses reflection to find the entry points to call for request processing. The technique used by asp.net host hosting was formalized and became suppported

    https://learn.microsoft.com/en-us/dotnet/framework/unmanaged-api/hosting/clr-hosting-interfaces-added-in-the-net-framework-4-and-4-5

    Originally dotnet was supported like Java, you used a standalone executable to load and host. But windows XP defined the PE format and added support to run clr programs directly, that is the clr host is automatically loaded

    When dotnet core was released, they faced the same issue, but decided not to modify the o/s to run core apps directly. The first release created a script file that used dotnet.exe to run the app dll. Later versions a stripped down version of dotnet.exe was copied and named after the exe. Now that all the hosting been moved to a c++ dll, the dotnet .exe generates and compiles a small c++ program to host and run the dll.

    As compile to native was required to run .net core on IOS, this feature is being supported in more O/S versions.

    0 comments No comments