は、あなたのApp
クラスに次のメソッドを追加します。あなたのApp
コンストラクタで
private static void UnhandledError(object sender, UnhandledErrorDetectedEventArgs eventArgs)
{
try
{
// A breakpoint here is generally uninformative
eventArgs.UnhandledError.Propagate();
}
catch (Exception e)
{
// Set a breakpoint here:
Debug.WriteLine("Error: {0}", e);
throw;
}
}
を:
public UnitTestApp()
{
CoreApplication.UnhandledErrorDetected += UnhandledError;
// ...and any other initialization.
// The InitializeComponent call just sets up error handlers,
// and you can probably do without in the case of the App class.
// This can be useful for debugging XAML:
DebugSettings.IsBindingTracingEnabled = true;
DebugSettings.BindingFailed +=
(sender, args) => Debug.WriteLine(args.Message);
}
は、あなたが良いスタックトレースを取得しない場合は、まだありますが、これはあります役に立つことが多い。
別のアプローチは、例外がスローされたとき(デバッグ、Windowsの、例外設定経由で)分割することです。
例外が発生した場合は例外を処理する必要があります。例えば、試しキャッチ?ここであなたが探している答えがわからない – Default
XAMLの例外です。 – Janak
@Default、問題はどこにスローされるのか分からず、デバッガに表示させたい) –