Sachin Singh

Sachin Singh

  • 7
  • 55.8k
  • 82.9k

Instantiation of ASP.NET Core application in production

Jan 13 2022 8:32 AM

There is a question on stackoverflow which says

When developing a .NET Core web application, I have to build it locally (by Ctrl-F5 for example). When doing that, Main method is running,So, in which way the remote web server is being informed about Main().

The accepted answer is

Program .cs and Startup .cs are running only the very first time an Http request is being made. It is this first time which configures Kestrel and informs it about everything it has to know for any subsequent request (e.g. routing).

which i think is completely wrong answer. However other answers seems logical

https://stackoverflow.com/questions/49033299/instantiation-of-asp-net-core-application-in-production

If anyone have a clear idea, how the Main() starts in production,where there is no way to start by ctrl + f5, No IIS ISAPI module, No url-rewriting module for Apache.
 
Note:- was not able to POST the question directly, so asking in answer. @Admin, please let me know the reason.


Answers (5)