Justin Cooney

Web Development Tips and Examples

I was setting up an ASP.NET application in IIS 8 when this error message all of a sudden popped up:

Error: Cannot Write Configuration File due to Insufficient Permissions

I wasn’t sure what was going on at first… why was IIS saying it didn’t have the right level of permissions to write to a file? I couldn’t continue with the site setup since I was unable to change the default document settings in IIS or the .NET Authorization rules. The error would just keep showing.

I started trying to adjust all sorts of permissions before I realized: wait a second… could the ReadOnly setting be toggled on the Web.config file?

And that was exactly the problem. The Web.config file had been set to read-only. As soon as I clicked the read-only toggle off on this file, I was able to continue changing the settings that I needed to get the site up and running in IIS.

It would be nice if some of these Microsoft error messages could be more exact as to what problem is happening. This error had me wondering about permissions settings in the Web site folder/files, while the actual issue was a simple read-only setting on the Web.config file. If you ask me, Microsoft should just set this error as:

Error: Cannot Write to Configuration File due to Read-Only being set to true

There, isn’t that much clearer? The problem and the actual solution in one simple error message

 

Posted in , , , , , ,

5 responses to “IIS: Cannot Write Configuration File due to Insufficient Permissions”

  1. David V. Corbin Avatar

    The thread is old…but I want to point out that there is a “flip side”….from a security standpoint giving out ANY information about why an operation failed increases risk…

  2. Gaz Avatar
    Gaz

    Thanks pal, exactly my issue

  3. Moe Avatar
    Moe

    I have had this a few times, only now have I found this solution which worked, thanks alot!

  4. smrutiranjan jena Avatar
    smrutiranjan jena

    Thanks dude.You have saved my time !!

  5. Fadzli Avatar
    Fadzli

    Great! Save our time. Thank you!

Leave a comment