1
votes

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.

1
It's due to the file extension of "*.min.css". See if [this technique][1] helps: [1]: stackoverflow.com/questions/11980458/… - WiredPrairie
This is totally correct, and completely answers this issue. - RyanKeeter
Stack Overflow didn't like my short answer and automatically moved it to a comment. :) - WiredPrairie

1 Answers

2
votes

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.