【发布时间】:2021-10-09 18:35:51
【问题描述】:
我正在使用 VS2022 Preview 并使用 Angular 和 VS2022 中的默认项目创建了一个单页应用程序。我已经搭建了身份页面,以便我可以通过使用 Bootswatch 中的一个覆盖引导程序来更改样式。但是,当我尝试从 wwwroot 中的 lib 文件夹中引用引导程序时,如下所示:
<link rel="stylesheet" href="~/lib/bootstrap/css/bootstrap.min.css" />
然后我得到错误:
Refused to apply style from 'https://localhost:5002/lib/bootstrap/css/bootstrap.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
我在这里尝试了各种文件路径,但似乎没有任何效果。任何帮助都会很棒,因为这似乎是一项微不足道的任务!
【问题讨论】:
-
在 ASP.NET Core SPA 中默认使用 Bootstrap,为什么还要重新添加呢?
index.html中不是已经添加了吗?
标签: c# angular asp.net-core asp.net-identity razor-pages