what exactly is the ASP.NET Core 5 host?

bhavna 106 Reputation points
2021-09-02T20:50:02.893+00:00

After the build, inside the bin folder, there are 2 main files {AppName}.exe and {AppName}.dll, what I understand is AppName.dll is the actual compiled application Code and AppName.exe is the host who hosts the App inside Kestral.
My question is, is this ".exe" is due to the Program.cs, and is it the one that acts as a worker process under which our application runs because we get the process name as Application name for ASP.NET Core 5 and not dotnet (dotnet.exe) anymore.
And if I am not wrong the application itself acts a the worker process to run the application code?

Developer technologies ASP.NET ASP.NET Core
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-09-03T22:46:22.203+00:00

    any .net core app is a dll, that you run with the dotnet.exe.

    dotnet run myapp.dll

    the exe is lightweight version of dotnet.exe renamed to your app name. its job is to load and run the .net core dll (matching its name). This is the .net IL host/bootstrapper which contain the jit compiler and the .net core IL vm.

    Kestrel is a library included in the .net runtime packages. The host builder in program.cs will look at the args and configuration values to determine if Kestrel will host the pipeline or another library will be used.

    again the Kestrel magic is all done by the builder pattern used to configure the program at startup.

    https://en.wikipedia.org/wiki/Builder_pattern

    note: the old .net framework needed an IL host, but MS updated the windows O/S to detect that an exe was a .net exe and magically used a IL host (which contains the jit compiler). Because .net core is cross platform, this was not done.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.