title: Adding Bundles to existing ASP.NET Webforms solution
body: <p>I am trying to add Bundles to an existing ASP.NET Webforms solution but my bundles always render empty and I am unsure why. I have been following <a href="http://igorzelmanovich.blogspot.co.uk/2012/09/using-aspnet-bundling-and-minification.html" rel="noreferrer">this blog post</a>.</p>
  
  <p>So far I have:</p>
  
  <ul>
  <li>Added the Microsoft ASP.NET Web Optimization Framework NuGet package</li>
  <li>Ensured required references are included</li>
  <li>Tried using debug="false" and debug="true" in Web.config</li>
  <li>Added the following code to my solution</li>
  </ul>
  
  <p><strong>Global.asax.cs</strong></p>
  
  <pre><code>protected void Application_Start(object sender, EventArgs e)
  {
      BundleConfig.RegisterBundles(BundleTable.Bundles);
  }
  </code></pre>
  
  <p><strong>App_Start/BundleConfig.cs</strong></p>
  
  <pre><code>public class BundleConfig
  {
      // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkID=303951
      public static void RegisterBundles(BundleCollection bundles)
      {
          bundles.Add(new ScriptBundle("~/bundles/Global").Include(
              "~/js/jquery-{version}.js",
              "~/js/jquery-ui.js"));
  
          bundles.Add(new ScriptBundle("~/bundles/GlobalHead").Include(
              "~/js/modernizr*"));
  
          bundles.Add(new StyleBundle("~/Content/Global").Include(
              "~/css/site.css"));
      }
  }
  </code></pre>
  
  <p><strong>Site.Master</strong></p>
  
  <pre><code>&lt;head runat="server"&gt;
      &lt;asp:PlaceHolder runat="server"&gt;
          &lt;%: Scripts.Render("~/bundle/GlobalHead") %&gt;
          &lt;%: Styles.Render("~/Content/Global") %&gt;
      &lt;/asp:PlaceHolder&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;%: Scripts.Render("~/bundle/Global") %&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>Web.Config</strong></p>
  
  <pre><code>&lt;namespaces&gt;
      &lt;add namespace="System.Web.Optimization" /&gt;
  &lt;/namespaces&gt;
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>To be clear, when I open a web page and inspect the resources with chrome dev tools, I can see</p>
  
  <pre><code>Content/Site.css
  bundle/Global.js
  bundle/GlobalHead.js
  </code></pre>
  
  <p>But when inspecting them they have no content.</p>