In this article, we will find the role of the startup class in ASP.NET Core. We learned how the Program class is responsible for creating a Web Host and configuring it. But, before building and running the host, the program class checks for startup class for further configuration. It invokes the Configure & ConfigureServices the method from the class. This allows us to further configure the App startup.
In this article, we will look at the role of asp.net core program.cs in more detail. It is the entry point of our app, where we configure the Web host. The program class configures the application infrastructure like Web host, logging, Dependency injection container, IIS integration, etc. It is created, configured, built using the createdefaultbuilder method of the Main method in the program class.
In this tutorial, we will learn how to download and install .Net Core or Dot Net Core. The downloads consist of three parts. The SDK, runtime & Hosting bundle. Learn the difference between the SDK, Runtime & Hosting bundle. We have also listed dependencies that you must install before. Also the list of supported OS.
List of Best ASP.NET Core Books
Understanding the lifetime of the services created using the Dependency injection is very essential, before starting to using them. Creating services without understanding the difference between Transient, Singleton & Scoped lifetime can result in application behaving erratically. When a service requests another service via DI, knowing whether it receives the new instance or an already created instance is very important. Hence correctly specifying the lifetime while registering the service are utmost important.