When deploying my MVC application, the .NET 4.5 framework integrates and reduces my CSS. However, the resulting file is empty, so CSS rules are not applied. In Chrome, the warning Resource interpreted as Stylesheet but transferred with MIME type text/plain appears. In IE9, I get a CSS was ignored due to mime type mismatch warning that CSS was ignored due to mime type mismatch .
This is what is in my bundleconfig
bundles.Add( new StyleBundle("~/Content/bootstrap").Include( "~/Content/bootstrap/bootstrap-responsive.css", "~/Content/bootstrap/bootstrap-editable.css", "~/Content/bootstrap/FileUpload.css"));
Here is my layout:
<head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="IE=Edge" /> <title>@ViewBag.Title</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> <link href="@ViewBag.StyleUrl" rel="stylesheet" type="text/css" /> @Styles.Render("~/Content/bootstrap") <script src="~/scripts/libs/modernizr/modernizr-2.5.3.js" type="text/javascript"></script> </head>
An additional stylesheet is for a dynamically loaded stylesheet based on the configuration in our Admin tool.
When I run it locally, or if I set debug = "true", then I get my individual files and everything looks as it should. If I rigidly bind them to my layout page, they appear in order. I checked IIS and looked at the correct MIME type for CSS (which makes sense, given that hardcoded values ββwork). I also checked to make sure that the "Static Content" role service is installed, since I encountered it in my googling as well.
Any thoughts?
Scott silvi
source share