Hands-On Full:Stack Web Development with ASP.NET Core
上QQ阅读APP看书,第一时间看更新

Code execution order

The Startup class is executed only once during an application's lifespan, right after the web server has loaded the ASP.NET Core application.

The following screenshot shows the order of execution of the different methods in the classes involved in ASP.NET Core initialization:

The Startup class is not the place to put any code other than initialization and configuration code.