This project is read-only.

Enabling Web Optimization on IIS6

Dec 17, 2012 at 2:27 PM

I'm having problems getting ASP.NET Web Optimization framework to work on IIS6. It always uses the expanded bundles from the debug configuration. I have tried my deployment configuration on a second server running IIS7 and using everything works as expected.

However the production Server runs on IIS6 and I wonder if this Version is supported by Web Optimization. I have tried both stable and alpha versions.

Feb 13, 2013 at 2:46 AM

I tried ASP.NET Web Optimization framework on IIS6 and it works for my case so I wanted to know more about your scenario to which will help us investigate this issue better

Following is my BundleConfig
 var bundles = BundleTable.Bundles;
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
I could see that by switching the debug flag=true/false in web.config I was able to render out the minified/non minified version of jquery

Can you please post your sample application in particular your Bundle configuration?
Feb 13, 2013 at 11:12 AM

unfortunately I can't provide the full source code, because of legal issues.
I can send you the bundle configuration.

But before that I have to tell you something about the production system, maybe this could be the root of the issue:
The application runs as an ASP.NET 4.0 web application folder under an ASP.NET 2.0 root site (which is a necessity, because otherwise it would break the running website, which is maintained by a 3rd party)
I have noticed that this setup breaks the extensionless routing, so that it is necessary to register the routes the "old" way. Could this be also the reason why the bundling doesn't work?

The bundle configuration is really straightforward and looks as following
        public static void RegisterBundles(BundleCollection bundles)
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(

            bundles.Add(new ScriptBundle("~/bundles/knockout").Include(

            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

            bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(

            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(

            // App specific

            bundles.Add(new StyleBundle("~/Content/css").Include(
Feb 15, 2013 at 8:07 PM
This could be the problem....Bundling relies on routing and with your configuration since extensionless routes do not work, bundling will not work as well..
Feb 18, 2013 at 9:47 AM
Okay, I fixed it now by appending a .cssx extension to the css bundles and a .jsx extension to the javascript bundles and it works now!

  • Update the bundle configuration and the Script.Render and Style.Render calls in the view files
  • Add the mime-types for cssx and jsx (don't know if this is absolutely needed)
  • Add the ASP.NET handler mappings to the new file extensions
  • Deploy your application
Works like a charm!