Search code examples
asp.net-mvcbundle

BundleConfig returns 302 / 404


I can't for the life of me understand why my project developed this issue.

I am using the .Net Framework 4.7.1. My bundle is defined as follows:

var styleBundle = new StyleBundle("~/assets/sass/aaaa").Include(
    "~/assets/sass/main.css"
);

// This transform adds a randomized version number to the end of the bundle name
styleBundle.Transforms.Add(new FileHashVersionBundleTransform());

bundles.Add(styleBundle);

And in the Layout page:

@System.Web.Optimization.Styles.Render("~/assets/sass/aaaa")

The request results in a 302 that is then redirect to my 404 error page.

What could I possibly be doing wrong?

A previous version (one week old) of my codebase running on a separate Application Pool works without issues, but in the main branch all my bundles no longer work.

EDIT: I already browsed the other questions on this same topic on this site and elsewhere. I attempted all the suggested changes to the Application Pool and Web.config, with no luck whatsoever.


Solution

  • I no longer desire for my answers to contribute to stackoverflow, due to both their changes to the code of conduct and the unilateral use of our answers to train OpenAI.