Wednesday, June 28, 2017

CSS bundleconfig doesn't work in asp.net mvc?

When using Bundle, do not append the .min

bundles.Add(new StyleBundle("~/Content/bootstrap").Include(
    "~/Content/bootstrap.css", 
    "~/Content/bootstrap-theme.css"));
Based on the debug setting, (mostly web.config)
  • debug="true" - the non minified version will be used.
  • debug="false" - *.min.css will be searched, and if not found, the current will be minified
web.config setting:

<system.web>
  <compilation debug="true"...

Ref: https://stackoverflow.com/questions/20869907/adding-bootstrap-in-bundleconfig-doesnt-work-in-asp-net-mvc