Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Starting in ASP.NET Core 6.0, Identity UI defaults to using version 5 of Bootstrap. ASP.NET Core 3.0 to 5.0 used version 4 of Bootstrap.
ASP.NET Core 6.0
AddDefaultIdentity<TUser>(IServiceCollection) calls the internal private method TryResolveUIFramework. TryResolveUIFramework
reads the UIFramework from the application assembly. The UIFramework
version defaults to:
Template-created ASP.NET Core 3.1 and 5.0 apps contain Bootstrap 4 in wwwroot\lib\bootstrap. Template-created ASP.NET Core 6 apps use Bootstrap 5. When an ASP.NET Core 3.1 or 5.0 app is migrated to .NET 6, the application detects UIFramework
version 5, while wwwroot\lib\bootstrap contains version 4. This version mismatch renders the Identity templates incorrectly.
Bootstrap 5 was released during the ASP.NET Core 6.0 timeframe.
Apps that are impacted by this change use the default Identity UI and have added it in Startup.ConfigureServices
as shown in the following code:
services.AddDefaultIdentity<IdentityUser>()
Take one of the following actions:
Add the MSBuild property IdentityUIFrameworkVersion
in the project file and specify Bootstrap 4:
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<IdentityUIFrameworkVersion>Bootstrap4</IdentityUIFrameworkVersion>
</PropertyGroup>
The preceding markup sets the UIFramework
version to Bootstrap 4, the same Bootstrap version as used in ASP.NET Core 3.1 and 5.0.
Rename or delete the wwwroot\lib\bootstrap folder and replace it with the wwwroot\lib\bootstrap folder from an ASP.NET Core 6 template-generated app. The Identity templates work with this change but apps using Bootstrap may need to refer to the Bootstrap 5 migration guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Secure a .NET web app with the ASP.NET Core Identity framework - Training
Learn how to add authentication and authorization to a .NET web app using the ASP.NET Core Identity framework.
Documentation
Razor file compilation in ASP.NET Core
Learn how compilation of Razor files occurs in an ASP.NET Core app.
ASP.NET Core MVC and Razor Pages in .NET 6
ASP.NET Core & Razor Pages are the foundations for many modern web apps. Check out what's new for ASP.NET Core MVC & Razor Pages in .NET 6 including Hot Reload, nullability checking, CSS isolation, Bootstrap 5, async streaming, IAsyncDisposable support, and faster build times.https://aka.ms/dotNETConf2021-GetdotNET6
Learn how to use common layouts, share directives, and run common code before rendering views in an ASP.NET Core app.
Learn how to serve and secure static files and configure static file hosting middleware behaviors in an ASP.NET Core web app.