2

I'm having an issue when BundleTable.EnableOptimizations = true; is set, the virtual URLs are returning 404s. This happens for both my JS and CSS bundles. Here is an example of a bundle I have:

  BundleTable.Bundles.Add(
      new StyleBundle("~/css")
          .Include("~/ui/basic/foundation.css")
          .Include("~/ui/basic/all.css")
          .Include("~/ui/basic/print.css")
      );

I have tried changing the bundle name/path to random characters to be sure that it was definitely not an existing path. I also tried adding bundle to my modules by:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
        <remove name="BundleModule" />
        <add name="BundleModule" type="System.Web.Optimization.BundleModule" />

I have bundling running in the same fashion on another project locally which is all working fine.

If anyone has any ideas what it could be that is causing the issue I would greatly appreciate the help.

PS: the project is sitecore using forms. (Same as the other project which is working fine)

David
  • 357
  • 1
  • 4
  • 13

1 Answers1

1

If you are using Form authentication on every page, you have to give permissions to the virtual directory that is created by the bundles. Even if that directory does not physically exists.

I had a similar problem once, it was resolved here:

Bundle Minification not working when publishing WebForms App

Community
  • 1
  • 1
RainierMallol
  • 806
  • 1
  • 8
  • 24