【发布时间】:2017-04-02 07:27:03
【问题描述】:
我有以下代码可以在 winforms 应用程序中使用 Program.cs 文件捕获未处理的异常
private static void OnGuiUnhandedException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
MessageBox.Show(e.Exception.Message);
MessageBox.Show(e.Exception.StackTrace.ToString());
MessageBox.Show(e.Exception.TargetSite.ToString());
Application.Exit();
}
我正在处理图像。我不断收到此异常
Object is Currently in use elsewhere
应用程序同时使用 2 个后台工作程序。 我一直试图从错误中指出确切的位置/行号。
从堆栈跟踪中我得到了这个
如何找到错误的确切位置?以便我可以采取适当的措施来纠正这个问题。
【问题讨论】:
标签: c# .net bitmap backgroundworker gdi+