How to solve Deadlocks

How to solve Deadlocks

My Application uses managed code in its execution.But as I am executing the program a deadlock error is arising.How can I solve it. the error message is as follws LoaderLock was detected Message: DLL 'E:\Windows\assembly\GAC\Microsoft.DirectX.AudioVideoPlayback\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.AudioVideoPlayback.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.
1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.