1

I'm still kind of new with ASP.NET MVC, so please excuse me if I'm missing something obvious. I recently just published a site through Visual Studio to our development server to see how everything was working. When I browse to the dev site, none of our styles or Javascript that were defined as bundles show up in our code.

Local test system rendered code: Working

Development server rendered code: Not working

As you can see between the two rendered source codes, there is no CSS being added to the published code. What can I do to fix this?

Thanks!

Colin Bacon
  • 15,436
  • 7
  • 52
  • 72
Chiggins
  • 8,197
  • 22
  • 56
  • 81
  • Can you give us an example of the bundle definition that you specified in your Bundle.Config class and the code that you used in your view to render this bundle. – Andre Lombaard Sep 17 '13 at 15:39
  • Here is my BundleConfig.cs file: http://pastie.org/8333347 And as I said below, I'm using `@Styles.Render("~/Content/css")` and `@Styles.Render("~/Content/themes/base/css")`. – Chiggins Sep 17 '13 at 15:42
  • That looks fine, I assume that you actually add the specific css files, for example .Include("~/Styles/SomeStyle.css"). As explained in my answer below you can also try to add BundleTable.EnableOptimizations = true; to your BundleConfig.cs class – Andre Lombaard Sep 17 '13 at 15:51

1 Answers1

2

Try to add the following line to your BundleConfig.cs file

BundleTable.EnableOptimizations = true;

Please note : If you are using bootstrap for MVC you might also have to add this line of code to BootstrapBundleConfig.cs

Andre Lombaard
  • 6,985
  • 13
  • 55
  • 96