我測試異常攔截,因此,我不需要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