What could be the reason for the disappearance of the ApplicationHost.config file in IIS?

성훈 정 0 Reputation points
2024-11-13T05:06:25.2633333+00:00

When I try to perform tasks like restarting or stopping sites in IIS Manager, or editing SSL bindings, or changing settings, a file write error occurs and the operation fails.

The file is not visible in the system32/inetsrv/config/ directory.

It's present in the backup history, but recovery fails.

Simple copy and paste also fails.

Is there any solution to this problem?"

Windows development | Internet Information Services
Developer technologies | ASP.NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Tom Tran (WICLOUD CORPORATION) 10 Reputation points Microsoft External Staff
    2025-07-01T08:30:01.84+00:00

    Hi @성훈 정,

    I see you're having trouble with seeing file write errors when trying to restart or stop sites, edit SSL bindings, or change settings in IIS. These issues usually happen when IIS can't access or find its main configuration file: ApplicationHost.config.

    Let’s look at a few common reasons this file might disappear or become unusable:

    1. Sometimes, Windows might lose track of files due to disk errors or corruption. If the system had a rough shutdown or there's a bad sector, ApplicationHost.config could be affected. You can check for this by running:
         chkdsk
      
    2. Security tools like antivirus or endpoint protection may mistakenly block or quarantine ApplicationHost.config. Please check your antivirus logs or quarantine folder to see if the file was flagged.
    3. Even if the file exists, you might not be able to access it due to NTFS permission issues. You can check permissions using:
      icacls "C:\Windows\System32\inetsrv\config\ApplicationHost.config"

    If you see (I) next to the permissions, that means they are inherited from the parent folder. Look for (F) which means Full Control. If your account only has (R) (Read), you won’t be able to modify or restore the file.

    Here are a few steps you can try to restore or recover the missing configuration file:

    1. Run this command to list all files, including hidden ones:
         dir /a "C:\Windows\System32\inetsrv\config"
      
    2. IIS automatically creates backups in: %windir%\system32\inetsrv\backup To restore a backup:
         iisreset
         appcmd restore backup "Backupname"
         iisreset
      
    3. If you can't copy the file normally, boot into Safe Mode and try again. You can also use a recovery tool or bootable USB to copy the backup file manually.
    4. As a last resort, you can reinstall IIS or repair the configuration using DISM:
         DISM /Online /Cleanup-Image /RestoreHealth
      

    For more information, you can check out:


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.