ASP.NET MVC: Bundle not rendering

Today I came across a strange issue in my ASP.NET MVC project. The js script and css style bundles were not rendering. I tried removing the files in the bin and the obj folders, but the problem still continued.

On searching the web, some forums suggested to use bundles.IgnoreList.Clear() in the BundleConfig class. I tried it and the css and js files rendered properly. Below is the screen shot of my BundleConfig class after adding bundles.IgnoreList.Clear(). I’m not sure on the reason behind this, but the fix worked.

Using bundles.IgnoreList.Clear()

bundles.IgnoreList.Clear()

UPDATE (26th Aug 2016):

I’ve figured out the reason, why the bundles were not rendering for me before using bundles.IgnoreList.Clear(). That’s because I was using a .min.css file in the bundle. If you notice the above image, I’ve added foundation.min.css file. MVC 4 and above has .min in the default ignore list. That’s the reason the bundle was not rendering in the first place. After adding bundles.IgnoreList.Clear() the default MVC ignore list got cleared and the .min extension file started rendering. Clearing the ignore list is not the correct way of using the bungle. It will be always good not to include .min extension files in the bundle as bundling process will take care of the minification of the js or css file.

4 comments for “ASP.NET MVC: Bundle not rendering

  1. Sagar rana
    March 12, 2015 at 11:57 pm

    Thanks ….worked…looks like MVC 4 issue

  2. Hasthi
    February 26, 2015 at 6:17 pm

    Thank you very much..woks for myself as well

  3. January 17, 2015 at 7:52 am

    Thank you! It works for me too.

  4. November 11, 2014 at 5:41 pm

    thanks this work for me (y)

Leave your thoughts...