LoaderLock was detected

Similar to the ContextSwitchDeadlock popup I had trouble with a couple of months back, I've recently been getting a "LoaderLock was detected" popup.

Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

The problem can be solved in the same way though, by switching off the MDA:

Debug -> Exceptions -> Managed Debug Assistants

and unchecking the LoaderLock item.

[Tags: ]
10 August 2006