我测试异常拦截,因此,我不需要Visual Studio在thrown new NullReferenceException("myVar")
这样的thinkgs上中断。防止Visual Studio在抛出异常时中断
我在调试=>例外
然而,VS的异常打破了下面。我该怎么办?
PS。
为应用程序未处理的异常,我“赶”他们使用Application.UnhandledException
如下列:
''' <summary>Occurs when the application encounters an unhandled exception.</summary> '
Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
Dim message As String = String.Format("An application UnhandledException were thrown.{1}The application will now terminate.{1}'{0}'{1}{1}StackTrace:{1}{2}", e.Exception.Message, Environment.NewLine, e.Exception.StackTrace)
MessageBox.Show(message)
End Sub
尝试捕捉它,如果可能? – lxcid 2011-04-12 15:45:04
这只显示VS在抛出时不会中断所有异常。您需要钻取CLR异常节点以查看是否检查了单个异常。 – CodeNaked 2011-04-12 15:46:39
@CodeNaked:我验证:System.NullReferenceException未被选中。 – serhio 2011-04-13 08:08:06