DLL 'C:\Windows\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll' is 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.
How can I use it?
Debug-->Exceptions-->managed debugging assistances-->Loader Lock(uncheck thrown)
In reference to Rob Graham: Hmmm, I googled this "attempting managed execution inside OS Loader lock" problem and found this answer in CodeProject!!!!!
Anyway, I had the error message on another third product DLL. My program had been compiling and working fine. Then I did a full build and got this error the next run. I restored all source code from backups and still received the error!
The real problem: During my testing of a module, I turned on Exception handling to wake up the debugger when the exception is first thrown. The next time I did a full compile, everything had this option set. The third party DLL was throwing this error, catching and handling it but when I turned on this exception option, then the debugger woke up.
The solution: set Exceptions back to normal.
Had I run the compiled program without the debugger I think it would have worked.
Goto:- Debug -> Exception and click on Managed Debugging Assistant then uncheck the loader check
you have to click on debug menu of your Visual studio and then click on Exception and click on Managed Debugging Assistant and then uncheck the Loader .. now build your application...
Goto:- on your visual studio go to Debug -> Exception and click on Managed Debugging Assistant then uncheck the loader check .
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)