Recently one of my SharePoint WFE’s servers applicationHost.config files became corrupted on the server. I think that the low disk space on the system partition may caused this at a server or service restart, but not 100% sure about this. Anyway IIS7 was throwing errors out with the text below when I tried to access the websites and application pools in the managemet console.
” The Windows Process Activation Service encountered an error trying to read configuration data from file ‘\\?\C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ’1′. The error message is: ‘Configuration file is not well-formed XML’ “
So all websites and web applications were unavailable.
Opening the path mentioned in the error message C:\Windows\system32\inetsrv\config\, I noticed that the applicationHost.config files size was 0kb.. the whole config content was missing. Luckily IIS7 keeps some configuration backups under the inetpub\history folder and automatically saves them every time there is a change in IIS.
To access the history of the applicationHost.config file.
- Browse to C:\inetpub\history directory
- Inside this directory you will find the history of all the applicationHost.config and administration.config files.
- Pick the latest applicationHost.config file that you know is not corrupted.
- Copy the applicationHost.config file and paste it into the C:\Windows\system32\inetsrv\config directory.
After this operations you should be able to access IIS7 again in the management console. This time IIS7 should open, and you should be able to access all your sites and web apps.
If the sites are still down (stopped) than you should try a restart action on them, and in some spacial cases we need to (re)start the W3PS service too. World Wide Web Publishing Service is the whole name in the Local Services Management Console (services.msc).