我遇到了一个问题,在bootstrap更新到v5.0.2之后,在WebGrease.dll中抛出了一个异常(NullReferenceException),而在bootstrap中,v3和v4工作得很好。
以下代码来自共享布局:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)下面是来自BundleConfig的代码:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/Site.css"));已从nuget管理器检查WebGrease是否已更新。
发布于 2021-11-01 10:47:15
找到了。https://stackoverflow.com/a/45056631/4179709将捆绑包配置更改为新的up捆绑包对象。不是bootstrap.js的ScriptBundle对象
https://stackoverflow.com/questions/68586804
复制相似问题