The Startup class

The Startup class is initialized and executed right after the web application starts. It is located under the project root folder in the Startup.cs file. This is where the application services and request pipeline components can be configured.

The Startup class contains two methods:

  • ConfigureServices: This is where services will be added to the project. For example, this is where logging or authentication services are added.
  • Configure: This is where services and request pipeline components are configured. For example, the settings for the authentication and logging services will be set here.

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.