ASP.NET Custom Error Pages Lock Violation

Notes to self:

refs:

IIS7 - Lock Violation error, HTTP handlers, modules, and the element

Forcing custom 404 pages for pages in URL Routing

Edit the file:

"C:\Windows\SysWOW64\inetsrv\Config\applicationHost.config"

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" />
</httpErrors>

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

image

Use the lock /unlock Actions on right of screen.

image

Then for the site do the same

image

Unlock the default path and allow absolute paths when delegated

image

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

Something worked – just don’t know what!