0

未処理の例外に次のコードを使用しています。

private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
    {
        if (System.Diagnostics.Debugger.IsAttached)
        {
            // An unhandled exception has occurred; break into the debugger
           System.Diagnostics.Debugger.Break();
        }


        e.Handled = true;
        Error.Exp = e.ExceptionObject;
        (RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Source = new Uri("/Error.xaml", UriKind.Relative);
    }

このコードはコントロールをページに誘導する必要がありますが、(ブロックError.xamlをコメントアウトした後でも) 例外のエラー メッセージと共に Visual Studio に移動します。ifここで何が問題なのですか?

誤差の元は

GeneralTransform generalTransform1 = canvas1.TransformToVisual(start_rec);

エラー メッセージは、「引数の例外が処理されませんでした。パラメーターが正しくありません」でした。

4

1 に答える 1

0
        try
        {
                   // do something with your crash , report it or write log
        }
        catch
        {
        }
        if (System.Diagnostics.Debugger.IsAttached)
        {
            // An unhandled exception has occurred; break into the debugger
            System.Diagnostics.Debugger.Break();
        }

デバッグは、例外がスローされる場所に移動します。

于 2012-10-16T07:17:52.843 に答える