Click here to Skip to main content
15,889,528 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
VS 2012 automatic bundling of javascript and css seems like such a good idea. There are difficulties though like the css might just not show up. It is different in different browsers, but I finally got this message in IE - "CSS was ignored due to mime type mismatch". That makes sense if you look at the page source.

<link href="/Content/themes/base/css/cssbndle" rel="stylesheet"/>

Nowhere does it say "type="text/css".

Any suggestions? Thanks in advance, Mike


PS. Other trip ups with bundling to know about...
1. Bundling is not necessarily automatic in the release version. You may have to force it in Global.asax.cs with: BundleTable.EnableOptimizations = true; /// Forces Bundling
2. Do not name the bundle the same as a css file in the bundled directory or it will fail.
3. Put the css bundle file in the same directory as the css source if you want relative links to resources to work.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900