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: visualstudio debugging mda loaderlock]