A convention-based approach lets framework behavior follow recognized names, method shapes, and application structure instead of requiring every relationship to be registered explicitly. In ASP.NET Core’s older Startup pattern, conventions organize configuration for services, middleware, and endpoints, but can be difficult for newcomers to discover. section 30.5
The convention gives applications a consistent shape, yet it can also hide how bootstrapping works. Configuration is commonly split between Program.cs and Startup, although services and middleware can be registered elsewhere through builder methods. section 30.5
Startup registration
A host builder can connect the web host to a Startup class with UseStartup<Startup>(). That single convention-based link allows Startup to define application services, middleware, and endpoints. section 30.5
public static IhostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging => logging.AddSeq())
.ConfigureAppConfiguration(config => {})
.ConfigureServices(s => {})
.ConfigureHostConfiguration(config => {})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
Inspect the host-builder chain to see where Startup is selected and where related configuration conventions fit. section 30.5
