How to fix the error "Cannot write Configuration file" while changing any site bindings

Gudimalla Akhil 0 Reputation points
2023-03-11T17:42:44.18+00:00

whenever I try to change any site bindings I get the error below:

Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Error: Cannot write configuration file

1. The disk space is enough.
2.checked the permissions on the applicationHost.config file, no problem with that too.

Would like to know what is the problem and fix for this!
Windows development | Internet Information Services

3 answers

Sort by: Newest
  1. Lex Li 6,127 Reputation points
    2026-11-25T04:52:03.3233333+00:00

    The error message itself is not sufficient to determine the root cause. I would suggest collecting the following diagnostic information first:

    Troubleshooting with IIS tools

    1. Reproduce the same binding change using AppCmd.exe from an elevated command prompt and share the complete error output, especially the HRESULT.
    2. Check the size and attributes of applicationHost.config using PowerShell:
         Get-Item "$env:windir\System32\inetsrv\config\applicationHost.config" |
             Format-List Length, Attributes, LastWriteTime
      
    3. Provide the Windows/IIS version, the existing binding configuration, and the exact changes you are attempting to make (protocol, IP address, port, hostname, SSL flags or certificate).
    4. Check whether modifying other IIS settings stored in applicationHost.config also fails. This helps determine whether the issue is specific to bindings or affects the configuration system generally.
    5. Capture a Process Monitor trace while reproducing the issue. Filter by the entire configuration directory, since the failure might occur during temporary file creation or file replacement.

    Troubleshooting with Jexus Manager

    You can also use Jexus Manager, which implements its own IIS configuration system rather than relying on Microsoft's native implementation for reading and writing configuration files.

    Back up your configuration first, and then attempt the same configuration change using Jexus Manager.

    • If Jexus Manager successfully saves the changes but IIS Manager and AppCmd fail, the issue is more likely related to Microsoft's native IIS configuration system or its file-saving mechanism.
    • If Jexus Manager also fails, check its logs for more specific .NET exceptions that might reveal the underlying file access or XML processing issue.

    Verify the actual changes in applicationHost.config rather than relying solely on the UI.

    This comparison can help narrow down the problem significantly.

    Was this answer helpful?

    0 comments No comments

  2. Liam Kelly 0 Reputation points
    2026-10-13T18:11:06.6333333+00:00

    So glad this is the top search result for this problem, It is so helpful /s

    Was this answer helpful?

    0 comments No comments

  3. Limitless Technology 45,176 Reputation points
    2023-03-14T08:46:45.1033333+00:00

    Hello

    Thank you for your question and reaching out. I can understand you are having query\issues related to site bindings can not be changed.

    Select file from applicationHost.config -> Properties -> Clear encryption Check box -> then try to edit the file.

    --If the reply is helpful, please Upvote and Accept as answer--

    Was this answer helpful?


Your answer

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