IIS7 - Lock Violation error, HTTP handlers, modules, and the <clear /> element

Posted by Daniel Schaffer on Server Fault See other posts from Server Fault or by Daniel Schaffer
Published on 2009-10-07T22:44:00Z Indexed on 2011/03/04 7:26 UTC
Read the original article Hit count: 1498

Filed under:
|
|

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.

© Server Fault or respective owner

Related posts about iis7

Related posts about ASP.NET