ASP.NET Custom Error Pages Lock Violation

Notes to self:


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

Forcing custom 404 pages for pages in URL Routing

Edit the file:



Edit the line taking off ,defaultPath from the allowAbsolutePathsWhenDelegated,defaultPath

<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated">
<error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
<error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
<error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
<error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
<error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
<error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
<error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
<error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
<error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />

In IIS manager top level, unlock the sections for allowAbsolutePathsWhenDelegated & defaultpath


Use the lock /unlock Actions on right of screen.


Then for the site do the same


Unlock the default path and allow absolute paths when delegated



Also worth setting the modules to unlocked in the config and in the UI.

Something worked – just don’t know what!

Add comment