-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ASP.NET Core C# project templates to use new minimal hosting APIs in .NET 6 #33944
Comments
Thanks for contacting us. We're moving this issue to the |
@DamianEdwards : are there examples of the new projects (or already converted templates?)? |
Thanks @Tratcher. I didn't even know that this could build. |
Services are on builder.Services, app.UseAuthentication() goes between the exception handlers and the routes. We'll update the StarterWeb templates and then you can copy or iterate on those as needed. |
@DamianEdwards : so you've done the work? |
@jmprieur sorry didn't realize the arrangement here that you typically update the parts of the files relevant to org auth. Would be great if you could update the templates to use latest version of |
@DamianEdwards, there isn't really an arrangement. To test the updated templates, I installed VS2022 and .NET 6. Will that be enough? or should I install internal bits for the runtime and SDK? (and in that case where to get them from)? |
It depends on how soon you want to test them. If you want to do it as soon as they're committed to the aspnetcore repo you'll need to set things up locally for development in the repo itself. Or you can wait until the changes flow to the SDK installer and then you can simply install a CI build from dotnet/installer |
Fixed in #7699bab0fc5b1451272c7873af45990932d3d148 |
The ASP.NET Core project templates included in the SDK should be updated to use the new minimal hosting APIs introduced in .NET 6 as they represent the new idiomatic way to bootstrap (configure and start) the relevant host for the majority of scenarios.
CreateHostBuilder
method would be removed as the patterns that were previously reliant on this are no longer necessaryStartup
class would be removed and its contents applied as applicable to the calls toWebApplicationBuilder
in Program.csThe text was updated successfully, but these errors were encountered: