RyanKeeter
RyanKeeter

Reputation: 6139

ASP .NET MVC 4.5 Style Bundling not outputting anything

I have an ASP .NET MVC 4 app with BundleConfig.cs in the App_Start folder and a call to this class and the RegisterBundles method within the Global.asax.

Everything works fine regarding the Script bundling, but the style bundling produces nothing.

  var bundle = new StyleBundle("~/bundles/css")
                            .Include("~/Themes/Rikkle.Web/Styles/app.min.css");
            BundleTable.Bundles.Add(bundle);

I access the above bundle on the page like so:

<link href="/bundles/css" rel="stylesheet" type="text/css"/>

I am manually calling the link as opposed to using @Styles.Render() because the page output NOTHING when I call this (again, all script bundling still works). When I go to localhost:xxx/bundles/css in the browser I get a Status Code of 200, everything is fine, just that the payload is nothing. When I go to localhost:/themes/rikkle.web/styles/app.min.css in the browser, it pulls up without an issue.

Also, I am referencing System.Web.Optimization, the latest drop from Nuget, in both my views folder web.config and the main web.config.

Upvotes: 1

Views: 1034

Answers (1)

RyanKeeter
RyanKeeter

Reputation: 6139

This question is answered by: Bundler not including .min files

Essentially, if you have "min," as in "app.min.css," then the bundling blows up.

Upvotes: 2

Related Questions