Click here to Skip to main content
14,698,806 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I build project with Microsoft Visual Studio 2010 and get this Error "Unhandled exception has occured in your application.." when play video in project, problem solve with disable LoaderLock in VS2010 toolbar Debug, Exceptions.. , Managed Debugging Assistants, Uncheck LoaderLock but after I created .exe and install to another client I get this error again

I searching to Disable Loaderlock with Disabling MDAs by Using a Registry Key https://msdn.microsoft.com/en-us/library/d21c150d.aspx I following this way but still doesn't work

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"MDA"="0" anybody tell me how to solve it? what should I do?

What I have tried:

videoFile = new AudioVideoPlayback.Video(file)
videoFile.Owner  = pnlVideo
VideoFile.Play()
Posted
Updated 18-Apr-17 0:36am
v3
Comments
Jochen Arndt 11-Apr-17 4:12am
   
Catch the exception and report it showing the detailed error message.
Further actions depend on the shown error.
Atakutabrak 18-Apr-17 5:00am
   
this is not about error code, just a piece of my code
I just ask how to Disable Loaderlock.. in VS2010 I can Disable Loaderlock through Debug, Exceptions.. , Managed Debugging Assistants, Uncheck LoaderLock
but in client how to? doesn't make sense I install VS2010 to all client then Disable the loaderlock one by one, right?

Put the code in TRY-CATCH to capture actual error you need to address..

try 
{
    videoFile = new AudioVideoPlayback.Video(file)
    videoFile.Owner  = pnlVideo
    VideoFile.Play()
}
catch(Exception ex)
{ 
    // you can get exception information here..
}
   
Your complete approach is wrong.

Instead of disabling the exception you should find the cause and fix that. Ignoring the execption may lead to a deadlock:
Effect on the Runtime

Typically, several threads inside the process will deadlock. One of those threads is likely to be a thread responsible for performing a garbage collection, so this deadlock can have a major impact on the entire process. Furthermore, it will prevent any additional operations that require the operating system's loader lock, like loading and unloading assemblies or DLLs and starting or stopping threads.

In some unusual cases, it is also possible for access violations or similar problems to be triggered in DLLs which are called before they have been initialized.

The ability to enable/disable these execptions is a debugging aid. It is not intended for release versions.

Have you tried to execute a debug build on a client?
Don't do so.
   

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