title: weboptimization css bundle not found (404)
body: <p>I have made an Asp.Net webforms website in C# using the .net framework 4.6.1.
  The website works perfectly but when I try to optimize the CSS load using the weboptimization component <strong>I get a 404 from the css url request</strong>.</p>
  
  <p>Please note that I have also the js bundle that works perfectly.</p>
  
  <p>in the .aspx page I have in the head:</p>
  
  <pre><code>&lt;webopt:BundleReference runat="server" Path="~/stylesheets" /&gt;
  </code></pre>
  
  <p>the bundle.config is in the root of the site structure and its content is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;bundles version="1.2"&gt;
    &lt;styleBundle path="~/stylesheets"&gt;
      &lt;include path="~/Bootstrap/css/bootstrap.css" /&gt;
      &lt;include path="~/css/style.css" /&gt;
      &lt;include path="~/css/custom.css" /&gt;
    &lt;/styleBundle&gt;
  &lt;/bundles&gt;
  </code></pre>
  
  <p>Inspecting the network request I see that the request for stylesheets
  <a href="https://i.stack.imgur.com/fw7ey.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fw7ey.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/iPmHh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iPmHh.png" alt="enter image description here"></a></p>
  
  <p>where base-site is instead the js bundle</p>
  
  <p>Global.asax file:</p>
  
  <pre><code>void Application_Start(object sender, EventArgs e)
  {
      RouteConfig.RegisterRoutes(RouteTable.Routes);
  
      BundleTable.EnableOptimizations = true;
      BundleConfig.RegisterBundles(BundleTable.Bundles);
  }
  </code></pre>
  
  <p>web.config:</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;authentication mode="None"/&gt;
      &lt;compilation debug="true" targetFramework="4.6.1"&gt;
      ...
  &lt;httpRuntime targetFramework="4.6.1"/&gt;
          &lt;pages enableEventValidation="true"&gt;
            &lt;namespaces&gt;
              &lt;add namespace="System.Web.Optimization"/&gt;
              &lt;add namespace="Microsoft.AspNet.Identity"/&gt;
            &lt;/namespaces&gt;
            &lt;controls&gt;
              &lt;add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/&gt;
            &lt;/controls&gt;
          &lt;/pages&gt;
          ...
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;modules&gt;
        &lt;remove name="FormsAuthentication"/&gt;
        &lt;remove name="BundleModule"/&gt;
        &lt;add name="BundleModule" type="System.Web.Optimization.BundleModule"/&gt;
      &lt;/modules&gt;
      ...
    &lt;/system.webServer&gt;
  </code></pre>
  
  <p>I have an identical website with the same web.config, same routing configuration with <em>EnableFriendlyUrls(True)</em> where the CSS bundle is correctly provided.</p>
  
  <ul>
  <li>It doesn't work both local on VS2017 and on the production server.  </li>
  <li>There is no folder or other pages named "stylesheets"</li>
  <li>The CSS files are well-formed</li>
  <li>I've tried also with a single CSS file, but I get always a 404.</li>
  <li>The routing for all the other pages and JS bundle works fine</li>
  </ul>
  
  <p><strong>Why the CSS bundle doesn't work?</strong> 
  Is there something I can do to understand where is the issue?</p>