I feel so dirty, but for a project I’m working on at the moment I have to use ASP.NET instead of PHP; “why?” is a question for another day. Anyway, I’ve installed IIS before so that wasn’t a big problem… or so I thought.
I already had the .NET 2.0 framework on my XP machine so went straight to installing IIS (5.1 comes with XP Pro). It installed easily enough and my hello world html file was served without any major problems (actually that’s not true, before I copied my own files across I tried to check the IIS default pages served ok only to discover, through more googling, that if I used IE instead of Firefox that annoying box asking me for a password would go away).
Now my ASP.NET issue. I got a Server application unavailable error message in big red letters when I tried to run any .aspx (ASP.NET) scripts and couldn’ t figure ou
t for the life of me why. The Event Viewer, where IIS errors are logged, gave little more by way of help:
Failed to initialize the AppDomain:/LM/W3SVC/1/ROOT
Err… What?! I worked out that it wasn’t affecting html pages, just ASP ones – and only .aspx ones at that, suggesting it was .NET-related.
As it turns out the problem was that I had installed .NET before IIS. It’s easy enough to fix, but it took 20 solid minutes of googling to find the solution in a Microsoft community newsgroup (and then realise that I’d have found it already if I’d just read to the bottom of a 4 year old forum post I’d already found).
Anyway, what you need to do if you’re getting this “Server application unavailable” message is navigate to your .NET directory (something like
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) in a command prompt and run the command
aspnet_regiis.exe -i which will register ASP.NET with IIS. If that still doesn’t work, there’s always PHP.net 😉