您的应用程序中出现[ERROR]未处理的异常。 [英] [ERROR] unhandled exception has occured in your application..

查看:156
本文介绍了您的应用程序中出现[ERROR]未处理的异常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft Visual Studio 2010构建项目并在项目中播放视频时出现此错误应用程序中出现未处理的异常...,在VS2010工具栏中禁用LoaderLock解决问题Debug,Exceptions ..,Managed Debugging Assistants,取消选中LoaderLock,但在我创建.exe并安装到另一个客户端后,我再次收到此错误



我搜索禁用Loaderlock并使用注册表项禁用MDA https:/ /msdn.microsoft.com/en-us/library/d21c150d.aspx我按照这种方式但仍然无法工作



[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft \ .NETFramework]

MDA=0任何人都告诉我如何解决它?我该怎么办?



我的尝试:



< pre lang =vb> videoFile = new AudioVideoPlayback.Video(file)
videoFile.Owner = pnlVideo
VideoFile.Play()

解决方案

将代码放入TRY-CATCH以捕获您需要解决的实际错误..



试试
{
videoFile = new AudioVideoPlayback.Video(file)
videoFile.Owner = pnlVideo
VideoFile.Play()
}
catch(Exception ex)
{
//你可以在这里获得异常信息..
}

你的完整方法是错误的。



你应该找到原因并修复它,而不是禁用异常。忽略execption可能会导致死锁:

对运行时的影响



通常,进程内的几个线程会死锁。其中一个线程可能是负责执行垃圾收集的线程,因此这种死锁会对整个过程产生重大影响。此外,它将阻止任何需要操作系统的加载程序锁定的其他操作,如加载和卸载程序集或DLL以及启动或停止线程。



在某些特殊情况下,在初始化之前调用的DLL中也可能触发访问冲突或类似问题。



启用/禁用这些execptions的能力是一种调试辅助工具。它不适用于发行版本。



您是否尝试在客户端上执行调试版本?

不要这样做。


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()

解决方案

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.


这篇关于您的应用程序中出现[ERROR]未处理的异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆