title: ASP.NET MVC Bundle not rendering script files on staging server. It works on development server
body: <p>In our ASP.NET MVC 4 web application, our BundleConfig.cs includes the following:</p>
  
  <pre><code>bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                          "~/Scripts/jquery-{version}.js"));
  
              bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                          "~/Scripts/jquery-ui-{version}.js"));
  
              bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                          "~/Scripts/jquery.unobtrusive*",
                          "~/Scripts/jquery.validate*"));
              bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                          "~/Scripts/modernizr-*"));
  </code></pre>
  
  <p>When we look at the html of the home page on development server, we can see the following script tags even though the debug mode in web.config is set to true as <code>&lt;compilation debug="true" targetFramework="4.0" /&gt;</code>:</p>
  
  <pre><code>&lt;script src="/AFR/Scripts/jquery-ui-1.8.20.min.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/modernizr-2.5.3.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/jquery-1.7.1.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/jquery-ui-1.8.20.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/jquery.unobtrusive-ajax.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/jquery.validate.js"&gt;&lt;/script&gt;
  &lt;script src="/AFR/Scripts/jquery.validate.unobtrusive.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But when we deploy the app on staging server and look at the html (View Source) of the home page, all of the above script tags with the exception of <code>&lt;script src="/AFR/Scripts/jquery-ui-1.8.20.min.js"&gt;&lt;/script&gt;</code> are missing. We've verified that all the files mentioned in these tags are in the script folder. The folder structure is exactly the same as on development machine. On staging server, the web.config fie has <code>&lt;compilation targetFramework="4.0" /&gt;</code> which means, by default, the debug="false".</p>
  
  <p>As a result, some of the JavaScript functions are failing on staging server. Both the staging and development machines are Windows 2012.</p>
  
  <p>Please help. Thanks.</p>