Hi,
CreateHostBuilder()
pattern is the .net5 way. Since .net6, the default template has cancelled the Startup.cs` file and use `WebApplication.CreateBuilder
like following:
var builder = WebApplication.CreateBuilder(args);
...
builder.Services.Add...
var app = builder.Build();
...
app.UseAuthorization();
...
app.Run();
It is not hard to migrate from the old pattern to new pattern. I also suggest you read this classic article talking about this https://andrewlock.net/exploring-dotnet-6-part-2-comparing-webapplicationbuilder-to-the-generic-host/
******************************************************************************
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.