Thursday, December 2, 2010

Problems Running IIS 7 in Classic Mode

Recently at work we ran into an issue where sites stopped working properly in Classic Mode in IIS7. All sorts of script mapping errors were occurring and the pages where loading incorrectly. When the sites where running in Integrated Mode everything was fine. However, switching the sites over to Integrated mode was not an option  as some of our sites need to be run in Classic Mode to support older methods of gathering statistics from IIS.

Eventually I figured out that the problem occurred because we had added new handlers in the Web.Config, from the outset it appeared that this was a configuration problem. So after a bit of fruitless Googling (I think my Google Fu is weakening of late) I started poking around in the IIS settings and Web.config. That is when I noticed that a few of the handlers had precondition="integratedMode" blindly removing this precondition didn't do the trick. Nor did a few other tweaks that I tried.

Eventually it came to me and I must admit that it took me a little while before I realised that the solution was actually kind of obvious, use the IIS6 Web.Config instead of the IIS7 one. While this may seem counter intuitive it makes sense when you realise that Classic mode was designed to emulate the operation of IIS6 so that sites and server configurations would not need to be changed immediately.

So there you have it, if you must run in Classic Mode on IIS 7 you may just need to use an old school Web.config to go with the old school classic running mode.

No comments:

Post a Comment