MVC4 bundle set giving 403

When merge / minification is enabled, some of my packages seem to have the wrong URL in the browser (ends with /), and IIS gives a 403 forbidden error, as if trying to list the contents of a folder.

There is no difference in how my packages are configured - they are not .min.css, permissions are correct, etc.

+72
asp.net-mvc razor asp.net-mvc-4 bundling-and-minification
Dec 02
source share
2 answers

My bundles were registered as paths that corresponded to the actual folder on the solution, for example. ~/Content/forum .

This works great when disconnecting a bundle (the bundle is turned on correctly!), But not when turning on the bundle.

The solution is to change the registered package name so that it is not the same as everything that exists on the file system.

+186
Dec 02
source share

In my case, the package was listed as the @Scripts.Render("~/scripts") , so IIS did not know how to service the actual js file, I changed the package name to represent the javascript @Scripts.Render("~/scripts.js") and fixed it. The same can be said about my set of styles.

+1
Nov 07 '15 at 20:31
source share



All Articles