IIS7 - Lock Violation error, HTTP handlers, modules, and the <clear /> element
- by Daniel Schaffer
I have an ASP.NET site that uses its own set of HTTP handlers and does not need any modules.
So, in IIS6, all I had to do was this in my web.config:
<httpModules>
<clear />
</httpModules>
However, if I try to do the same in the system.webServer area for IIS7, I get a 500 error when I try to view the site, and in IIS manager when I try to view the handler mappings, I get a popup box with the message:
There was an error while performing this operation
Details:
Filename:
\?\C:\Sites\TheWebSiteGoesHere\web.config
Line number: 39
Error: Lock violation
Line 39 is where the <clear /> element is.
Some googling led me to a solution involving running this command:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/modules
...but that did not solve the problem.