I ran into the problem that after update of bootstrap to v5.0.2 throws an exception (NullReferenceException) in WebGrease.dll while with bootstrap v3 and v4 works fine.
The code below from shared layout:
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
The code below from BundleConfig:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/Site.css"));
Checked WebGrease from nuget manager it is updated.
Found it. https://stackoverflow.com/a/45056631/4179709 change the bundle config to new up Bundle object. Not a ScriptBundle object for your bootstrap.js