Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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?
Posted
Updated 14-Mar-10 13:33pm
v2

Google is your friend[^]

Always Google for the answer before posting. It saves everyone time.
 
Share this answer
 
Debug-->Exceptions-->managed debugging assistances-->Loader Lock(uncheck thrown)
 
Share this answer
 
Comments
Member 11151914 14-Oct-14 6:04am    
Thank yoooooooooooooooooooooooooooooooooooooooooooooooooou
Member 12061506 30-Oct-15 11:36am    
I am using 2008 and i have unchecked the loader Lock, then it says, Error in the Application.

The problem comes
Dim videoFile As Video = New Video("C:\Users\dlp\Downloads\Video\How to Initially Configure a Cisco Switch Tutorial - YouTube.mp4", False)
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.

-rwg
 
Share this answer
 
Comments
Member 10785068 11-Jun-14 8:35am    
i dont have it in vs2012 web express what can i do

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900