IIS: There was an error when performing this operation

Posted by on Aug 30, 2016 in Asp.net

I recently started setting up a new dev box and a couple of solutions (bound to IIS) simply would not run. In the browser I was getting a 500.19 error while even attempting to open the configuration for the website in IIS greeted me with the completely unhelpful message of:

“There was an error when performing this operation”

While this message couldn’t be any less useful if it tried, it hinted that the problem was with IIS rather than the website. My initial thoughts were permissions, so after ensuring the IIS_IUSR account had access to the web.config file I next attempted to ensure all additional modules were installed.
The missing IIS rewrite module has bitten me I the past so I double checked that was installed – without it this is exactly the error message you would see, which led me to believe another missing IIS addon was at fault.

The steps I took to debug this though was to section by section go through my web config removing each section and attempting to load the site and/or let IIS parse the config.
When I removed the section pertaining to initialization optimisation this fixed the issue and I immediately remembered that this dependency was added a fair while ago, so much so that I completely forgot about it.

Voila, installing the missing module fixed the problem and the site worked fine, plus IIS could now parse the configuration file.