0

Server Application Unavailable when uploading Web.Config file

It always strikes fear into my heart when I see the word in Orange ‘Server Application Unavailable’ because seeing this message has always meant hours of frenzied work trying to fix the problem. There could be a quick fix though…

Different to the ‘Server Application Error’ message which normally has to do with coding, the ‘Server Application Unavailable’ message normally has to do with a system or a .net framework error. There are numerous reasons it could be happening such as a memory error when running on a multi-processor computer, installing a MS update or a host of other reasons.

Solving it is not always easy, and in some cases very difficult indeed. I’m not going to go through every possible suggestion, but I will describe a fix that I couldn’t see mentioned anywhere else, but worked for me.

The error occurred one morning when I made a slight, innocuous change to the web.config file. The change was minor, insignificant (it was a custom key) but as soon as it was uploaded – panic! So, I quickly changed it back – double panic! So, I restarted IIS – triple panic! So, I restarted the server – aaaarrrggghhh!

This went on for some time, and as it was starting to look as if there was no way back, I decided to completely re-create the website on IIS under a new name:

  1. I copied the existing code to a new directory (including the changed web.config)
  2. Created a new website on IIS using the same details, but pointing to the new directory
  3. Stopped the old website
  4. Removed the IP addresses from the old website in IIS
  5. Added them to the new website in IIS
  6. Set up the SSL certificate
  7. Started the new website in IIS
  8. Job done!

I think this solution has something to do with the Temporary ASP.NET Files and the way IIS holds onto them, but the above method, although a pain, is a working solution, and should help quickly receiver getting the dreaded ‘Server Application Unavailable’ again.

The other reason this could have happened is that the permissions on the web.config file were not correct. Next time I will make sure all the correct permissions are set on the file before I do any the above.