如何知道System.Windows.Forms.dll中System.InvalidOperationException的详细信息? [英] How to know details of System.InvalidOperationException in System.Windows.Forms.dll?

查看:284
本文介绍了如何知道System.Windows.Forms.dll中System.InvalidOperationException的详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行我的应用程序时,我在Visual Studio的输出面板的下面找到了异常日志。

When running my application, I found exception log below in Output panel of Visual Studio.


System类型的首次机会异常.invalidOperationException发生在System.Windows.Forms.dll中。

A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll

此应用程序的架构师如下。

This application's architect is as follows.


  • 第二个线程:将将项目添加到列表视图或将项目更改为列表视图命令放入队列。

  • 主线程:从队列中出队并执行每个命令定义的添加或更改操作。

我想知道从$ b调用的InvalidOperationException的详细信息$ b,但它仅显示在输出面板上,因此我无法捕获它来查看堆栈跟踪。
是否有办法知道它?

I want to know details of InvalidOperationException called from, but it's only shown on Output panel, so I can't catch it for viewing stack trace. Is there a way to know it?

推荐答案

找到位置的最佳方法像这样触发的异常是将调试器设置为在所有异常上都中断。

The best way to find where an exception like this is being triggered is to set the debugger to break on all exceptions.

您可以通过转到 Debug code>菜单,选择 Exception ... ,然后选中<$ c $旁边的 Thrown 选项c>公共语言运行时异常。无论何时何地都发生.NET异常,这都会中断。

You can do this by going to the Debug menu, choosing Exceptions... and checking off the Thrown option next to Common Language Runtime Exceptions. This will break anytime a .NET exception is thrown, regardless of where or whether it's handled.

这不会修复您的问题,但是它会帮助您识别它。

This won't fix your problem, but it'll help identify it.

这篇关于如何知道System.Windows.Forms.dll中System.InvalidOperationException的详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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