Click here to Skip to main content
15,302,859 members
Articles / Web Development / ASP.NET
Posted 2 Aug 2013

Tagged as


5 bookmarked

Recover IIS When ApplicationHost.config is Ruined

Rate me:
Please Sign up or sign in to vote.
5.00/5 (9 votes)
2 Aug 2013CPOL
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.


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: 

Image 1

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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Zhuyun Dai
China China
Over 10-years experience in using Microsoft technologies.
At present, working as the architect of a clustered real-time data delivery and visualization system, responsible for the design of component architecture, product packaging and deployment, also targeting private cloud solutions for future.

Comments and Discussions

QuestionThanks Pin
Member 1006086823-Jan-19 4:58
MemberMember 1006086823-Jan-19 4:58 
Questionit works Pin
ahuenupan8-Nov-18 8:44
Memberahuenupan8-Nov-18 8:44 
QuestionCorrupted ApplicationHost.config file ... other issues Pin
Michael Breeden31-Dec-14 3:13
MemberMichael Breeden31-Dec-14 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.