My Web Server’s Dead – Corrupt applicationHost.config

Hmm, today I find that IIS on my laptop suddenly won’t start as it has a corrupt applicationHost.config file. The event log says;

The Windows Process Activation Service encountered an error trying to read configuration data from file ‘\\?\C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ‘0’.  The error message is: ‘Configuration file is not well-formed XML
‘.  The data field contains the error number.

and that’s certainly true because when I look in that file it looks empty but, in fact, it’s blanked out with zeroes from opening it up in VS.

So…what to do? I’ve found various posts in forums saying “Reinstall your OS” but I really don’t have time for that. Many of those posts link this up with AntiVirus software damaging the file.

I switched on my Vista desktop in order to see if I could copy a similar file from there and it “exploded”. Something made a very loud bang and there was a strong smell of smoke. Not sure whether the power supply’s gone or what but it doesn’t smell too sweet so that’s not going to help right now. I hadn’t switched that box on for a while and clearly it’s been sulking waiting to electrocute me at the first chance that it got.

I then realised that all is ok because only 3 days ago I backed up my entire laptop with a “whole machine” backup.

I go to try and restore this one file out this backup set and I find….it doesn’t do that 😦

The Backup UI says;


And if I go into the Advanced Restore option and click on the “Restore Files” option I get;


and if I do the advanced thing and point it at my external backup drive then I get;


I guess I’ve never really understood ( or cared ) about the difference between “Whole Machine” and “Non Whole Machine” backups and now I’m paying the hard way. I’d kind of assumed that if I did a “Whole Machine” backup then I’d be able to pull files out of it individually at a later point but maybe you can’t. It would be very nice if you could – for me, there’s nothing worse than a Backup feature that proves to be unforgiving when you come to use it 😦 I guess it’s my fault for not reading all about it at some point although I do generally copy my own files manually to an external drive for just this situation but I tend not to copy IIS files as well.

However, I then found this TechNet article;

which pointed me to the right history folder ( I’d seen a forum post that had directed me to the wrong history folder ) and I found a recent history file and copied it over the top of my applicationHost.config and restarted IIS and all was well (for now).