Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Recover IIS When ApplicationHost.config is Ruined

0.00/5 (No votes)
2 Aug 2013 1  
Introduce how to recover IIS when it is broken by bad editing to applicationHost.config

Issue Description 

Sometimes we have to manually modify applicationHost.config. It is risky because bad editing can ruin the file and cause IIS to be broken. IIS cannot recover even after we have fixed the errors in all applicationHost.config files appeared on the machine and have restarted the machine.

Solution 

The solution is to use AppCmd.exe. We can find it in C:\Windows\System32\inetsrv.

First, we use "appcmd list backup" to display all the available backups. Then we pick out a proper backup and use "appcmd restore backup <backup name>" to recover IIS. You could see these steps in the following screenshot: 

Note: You need to open the backup file and check if it contains errors before you choose it to recover IIS. You could find these backup files in C:\inetpub\history. The sub folder names are the same as the backup names.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here