Attempting to execute managed code inside the OS loader lock. Do not attempt to run managed code within a DllMain or image initialization function
Description
. NET2.0 has added 42 very powerful debugging assistants, Mda.loaderlock is one of them. LoaderLock detects the running of managed code on a thread that has an operating system loader lock. Doing so may cause deadlocks and may be used before the operating system loader initializes the DLL.
Method one (test pass)
General understanding: The form is not fully generated, and you call the other DLL at this time, you may throw this exception!
The vs2005 menu shortcut key ctrl+alt+e or debugging, exception->managed Debuggin assistants->loaderlock the selected state, if the exception (exception) This item is not, In the tool---Customize---commands tab---Left to select Debug--Right to managed the exception to the menu, modify the selected state of the Debuggin Assistants->loaderlock to remove
Method two in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\. NETFramework adds a string below, with a value of "0" but doing so on that computer is all based on the. NET2.0 Development does not get the benefit of (Mobile Desktop Assistant, or MDA, for short).
WinForm Problem Collection