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.
UPDATE (26th Aug 2016):
I’ve figured out the reason, why the bundles were not rendering for me before using bundles.IgnoreList.Clear().
It’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.