Share via

ASP.NET Core flow

bhavna 106 Reputation points
2022-01-11T18:49:27.797+00:00

Is it like this?

OS(windows/Linux)------->dotnet.exe/w3wp.exe/app.exe (for ASP.NET 5/6)------->App.dll (having Main())-->start kestrel to listen http requests.

OR

OS(windows/Linux)------->dotnet.exe/w3wp.exe/app.exe (for ASP.NET 5/6)------->Main()[Console APP]--->kestrel-->appname.exe---.>App.dll 

which one is correct or None of the above?

My question basically is, what is the role of appname.exe when you have dotnet.exe, or dotnet.exe has no role in asp.net core 3+ (5/6)?

Developer technologies | ASP.NET Core | Other

Answer accepted by question author

Bruce (SqlWork.com) 84,086 Reputation points
2022-01-14T17:17:54.563+00:00

.net is a virtual machine language like java. the compilers create il code, so a program is required to load and run the IL code.

For classic .net, a custom exe was generated that had a snippet of code to load and run the IL code that was embedded in the exe. This required a custom exe format be created to host the embedded IL code.

the .net core is cross platform, so the exe hack wasn't done. instead a lightweight exe is created that loads and hosts the app dll. If I remember correctly, in the original core release it was just a bat file. the main difference of this implementation is no application code is included in the produced exe. so it really makes no difference if you run the code with dotnet, or the generated exe.

the AspNetCore host module supports .net core two ways. the first is out of process, or reverse proxy. in this case it need an exe to run. you can either use the dotnet command line or the generated exe. if in process, then a dedicated app pool is required, and host module loads and runs the app dll directly. in this case you specify the dll name.

here is the docs on actually hosting .net core application in C/C++ so you can write your own host:

https://learn.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting

note: the .exe extension is only used on windows.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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