title: Bundling not working in MVC5 when I turn on release mode
body: <p>I have the following bundle configured in BundleConfig.cs:</p>
  
  <pre><code>bundles.Add(new StyleBundle("~/bundles/css").Include(
                        "~/assets/bootstrap/css/bootstrap.css",
                        "~/assets/css/global/all.css"));
  </code></pre>
  
  <p>and I reference it using the following:</p>
  
  <pre><code>@Styles.Render("~/bundles/css")
  </code></pre>
  
  <p>When I'm in debug mode (web.config compilation <code>debug="true"</code>) it works as expected in that it renders both css files as normal ie:</p>
  
  <pre><code>&lt;link href="/assets/bootstrap/css/bootstrap.css" rel="stylesheet"/&gt;
  &lt;link href="/assets/css/global/all.css" rel="stylesheet"/&gt;
  </code></pre>
  
  <p>However when I set <code>debug="false"</code> the above behaviour still occurs in that it does recognise the files, however it's just rendering them as normal.</p>
  
  <p>To confirm bundling can definitely work I've enabled optimizations in BundleConfig ie <code>BundleTable.EnableOptimizations = true;</code></p>
  
  <p>Whenever I do the above, it bundles the css and appears as expected ie:</p>
  
  <pre><code>&lt;link href="/bundles/css?v=WBKHkZAJly7jUzHrVDT8SwfaQE-CA9dbOUQUlLKadNE1" rel="stylesheet"/&gt;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>A few people have mentioned that adding the following code to my BundleConfig.cs file will achieve what I am after:</p>
  
  <pre><code>#if DEBUG
              BundleTable.EnableOptimizations = false;
  #else
              BundleTable.EnableOptimizations = true;
  #endif
  </code></pre>
  
  <p>I understand and appreciate this response, however according to the documentation, the default behaviour of MVC bundling is to bundle in release mode but not in debug mode. I don't see why I should need to add extra code to make it do this when it should be doing it already.</p>
  
  <p>EDIT 2</p>
  
  <p>I've a confession to make.  It turns out I had the web.config from the Views folder opened and not the main web.config.  I changed the setting in the main web.config and this works just fine for me. I blame ReSharper</p>