Using IIS, Asp.Net and Visual Studio, I kept getting the very uninformative error for every .aspx page (even simple hello world ones):
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable.
The server log was pointless, telling me nothing other than it was a 500 error.
It was serving html pages ok. I googled and googled, and tore my hair out and slept on it, and repeat... I ended up trying a few things, like:
- reinstalling IIS
- reinstalling IIS
- under Start->Administrative Tools->Internet Information Services (right click your site):
- making sure the home directory 'local path' is set to the right place
- ensure default.aspx is included as a default doc under the documents tab
- allowing IIS to control password under the security tab
- under 'Home Directory' tab making sure Execute Permissions is set to Scripts and Executables
- Setting the permissions on the default directory to allow IIS_WPG, including making sure that applied to all child files and folders.
What was useful was not the server log (under C:\WINDOWS\system32\LogFiles\) but the 'Event Viewer' (Start->Administrative Tools->Event Viewer). What you need to do to get a clue about what's going on is:
1. Try to load the aspx page that doesn't work.
2. In the event viewer, under 'Application', look at the most recent events that look likely candidates. Most likely the top ones.
This showed me a more useful error:
Failed to initialise the AppDomain:/LM/W3SVC/1/Root
Exception: System.Configuration.ConfigurationErrorsException
A bit of googling suggested reinstalling ASP.net and provided this convenient command for running at the DOS prompt:
%windir%\microsoft.net\framework\v2.0.50727\asp net_regiis -i -enable
When that didn't work, I changed the version to the ASP.net I had sent under Internet Information Services. So ultimately, what worked was running this command at the dos prompt:
C:\Documents and Settings\wdp921>%windir%\microsoft.net\framework\v4.0.30319\asp net_regiis -i -enable
C:\Documents and Settings\wdp921>%windir%\microsoft.net\framework\v4.0.30319\asp net_regiis -i -enable
There were too many blogs to reference them all here. While none of them alone provided the solution to the problem from start to finish they all led me to figure this out (at least I learnt a bit about IIS and ASP.net in the process) - so I don't claim credit for knowing the solution - I'm just putting it all here in one place in case it helps some one else, because one whole day is too much to waste.