private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show($"e.Exception?.Message}\n*********\n*e.Exception?.Data.ToString()}**********{e.Exception.StackTrace}");
e.Handled = true;
}
I use the above code in App.xaml.cs to catch any error unhandled in my code. If the Message would be : An item with the same key has already been added. because I tried to insert an existing key in a dictionary, how would I know which dictionary it was? Is that somewhere in e ? thanks Frank