简体   繁体   English

从 .NET 5 升级到 .NET 6 后,脚手架身份页面中的自定义 Bootstrap 4 UI 损坏

[英]Custom Bootstrap 4 UI in scaffolded Identity pages broken after upgrading from .NET 5 to .NET 6

I upgraded a .NET 5 blazor server app to .NET 6 and while .NET 6 apps now use Bootstrap 5 by default, I wanted to continue using Bootstrap 4, so I did not update my css or js files under wwwroot. I upgraded a .NET 5 blazor server app to .NET 6 and while .NET 6 apps now use Bootstrap 5 by default, I wanted to continue using Bootstrap 4, so I did not update my css or js files under wwwroot.

Most of the application UI looked the same after the upgrade except for the scaffolded Identity pages that I customized with Bootstrap 4 classes.除了我使用 Bootstrap 4 类自定义的脚手架身份页面外,大多数应用程序 UI 在升级后看起来都一样。 Looking in the browser dev tools, I could see that the css being loaded for the main part of the app was Bootstrap 4 but the css being loaded for the Identity pages was Bootstrap 5 (which has breaking changes).查看浏览器开发工具,我可以看到为应用程序的主要部分加载的 css 是 Bootstrap 4,但为身份页面加载的 css 是 Bootstrap 5(其中有重大更改)。

Microsoft announced the breaking change (moving from Bootstrap 4 to 5) here and gave a recommendation for those who wish to stay on Bootstrap 4 . Microsoft 在这里宣布了重大更改(从 Bootstrap 4 迁移到 5),为希望继续使用 Bootstrap 4 的用户提供了建议

The simplest solution: Add the MSBuild property IdentityUIFrameworkVersion in the project ( .csproj ) file and specify Bootstrap 4:最简单的解决方案:在项目( .csproj )文件中添加 MSBuild 属性IdentityUIFrameworkVersion并指定 Bootstrap 4:

<PropertyGroup>
  <TargetFramework>net6.0</TargetFramework>
  <IdentityUIFrameworkVersion>Bootstrap4</IdentityUIFrameworkVersion>
</PropertyGroup>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.Net Core 3.1 脚手架的身份页面并未全部使用(即登录页面正常,注册页面不正常)......为什么? - ASP.Net Core 3.1 scaffolded Identity pages not all used (ie. Login page OK, Register page NOK)…why? 从数据库表中搭建的ASP.Net DynamicData页面:有一种简单的方法可以更改它们的名称吗? - ASP.Net DynamicData pages scaffolded from DB tables: is there a simple way to change their names? .Net Core 2.1 项目在 IIS 上部署时不使用脚手架标识,而是使用 2016 年的旧模板 - .Net Core 2.1 project doesn't use scaffolded Identity when deploying on IIS, instead uses an old template from 2016 升级.net框架后,盾ui图表消失 - shield ui charts disappeare after upgrading .net framework 将项目从.Net 2.0升级到.Net 4.5后的Javascript问题 - Javascript problems after upgrading project from .Net 2.0 to .Net 4.5 .net身份自定义身份验证 - .net identity custom authentication 在我搭建 Identity 后没有错误的空白页面 - Blank page with no error after i scaffolded Identity Asp.net核心使用实体框架添加支架式剃须刀页面:运行所选代码生成器时出错 - Asp.net core add scaffolded, razor pages using entity framework: there was an error running the selected code generator ASP.NET 核心 2.1 标识:如何删除默认 UI razor 页面? - ASP.NET Core 2.1 Identity: How to remove the Default UI razor pages? 从asp.net 1.1升级到3.5后的性能问题 - Performance issues after upgrading from asp.net 1.1 to 3.5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM