Optimized packages returning 404 when requested from a website

I am having this strange problem when I install:

BundleTable.EnableOptimizations = true; 

When I try to open my site, it just doesn’t load, when I open the Chrome console, I see the following message:

GET / localhost / bundles / scripts / angularjs / commonmodules? v = 13-uWpwzN3U6kiHVssXRdpywHxrn09twvYKwoDVN3SU1 404 (not found)

However, if I try to open the link shown on the chrome console, it will load just fine, in other words, the link is found when I try to open it directly, but the server (IIS 7.5) returns 404 when the page tries to link it to the tag.

Has anyone experienced such strange behavior?

The virtual paths for my packages are not displayed for any existing file or directory, I include them using the following code:

 var myBundle= new ScriptBundle("~/bundles/scripts/angularjs/bootstrapping"); bootstrapping.Include("~/app/app.js") .Include("~/app/config.js") .Include("~/app/config.exceptionHandler.js") .Include("~/app/config.route.js"); bundles.Add(bootstrapping); 

And I already tried to add the following lines to web.config system.webServer:

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

I'm not sure if this could be related, but I use Umbraco v7 on this website, and this only happens if I set EnableOptimizations to "true".

+6
source share
1 answer

If I remember his configuration of umbraco correctly.

Find the key umbracoReservedPaths (in appSettings ) in web.config and add the path to the links there, for example:

 <add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/bundles/"/> 
+13
source

All Articles