Why are my style bundles not rendering correctly in ASP.NET MVC 4?

前端 未结 4 1249
天命终不由人
天命终不由人 2021-01-31 08:04

So I am new to ASP.NET MVC 4 (well, I used 3 a little).

Anyway, in my BundleConfig.cs file, I am trying to load the Twitter Bootstrap css files and an additional s

4条回答
  •  独厮守ぢ
    2021-01-31 08:50

    Just to let anybody else know who cant find a working solution easily in this long thread, I had the exact same issue and i solved it in the same way as suggested in edits found at the bottom of the actual question!

    I started a new project MVC4 Web Application, created routes for bootstrap bundles in the exact same code shown above:

    bundles.Add(new StyleBundle("~/Content/css").Include(
                "~/Content/bootstrap.min.css",
                "~/Content/bootstrap-responsive.min.css",
                "~/Content/site.css"));
    

    But due to unknown reasons, it was not loading.. Finally i gave up and decided to google it and found this page.

    I tried adding the following as the first line in BundleConfig.cs file. Recompiled and everything started working and now the styles were correctly being loaded now.

    bundles.IgnoreList.Clear();
    

    Maybe this helps somebody.

提交回复
热议问题