I ran into another issue today with my ASP.NET application. This time it was running on a developmentserver with Windows Server 2003 R2 Standard x64. At close of business yesterday, the 2.0 applicationwas running fine. I came back in this morning and tried to access it, however, but found that I got a cryptic "Service Unavailable" message.
Well, it was obvious that something had changed since I left yesterday, so I viewed the server's system log and found that the Application Pool was unable to start. Great, but why couldn't it start? Well, I dug around some more and found a more meaningful log at: c:\windows\system32\logfiles\httperr. This log told me that the application was trying to run using ASP.NET 1.1. What? Well, this pointed me to IIS Manager, where I found that ASP.NET 1.1 had been installed (maybe I should've looked there first, but I wanted to learn something this morning). 1.1 had been installed on the machine by a coworker to support another application, not knowing that it would break my application in the process.
No problem; at least I now knew the source of the problem. How to fix it, though?
Well, first we uninstalled ASP.NET 1.1 and the application that it supported, as it wasn't critical that it be installed on this server. I then tried to restart the application, but now got a new error message: "%1 IS NOT A VALID WIN32 APPLICATION." Okay. So, then I switched IIS from 32-bit to 64-bit mode, as it was still running in compatibility mode to support the now defunct ASP.NET 1.1. To switch it, I used the following command: cscript c:\inetpub\adminscripts\adsutil.vbs SET /w3svc/AppPools/Enable32BitAppOnWin64 False.
Next, I had to re-register ASP.NET 2.0 with IIS, which is detailed in a post that I wrote earlier this month. After that, the application came up fine - no errors at all!
Here's a link to a really helpful blog post from David Wang about 32-bit, 64-bit, and IIS.