title: wpf c# DispatcherUnhandledException not firing
body: <p>I am in the process of creating a new WPF application and wanted to implement the DispatcherUnhandledException handler.</p>
  
  <p>My application is using a custom [STAThread] to handle the application startup rather than the App.XAML</p>
  
  <p>As you can see I register the handler in the Main() method:</p>
  
  <pre><code>    [STAThread]
      public static void Main()
      {
         var application = new App();
         application.DispatcherUnhandledException += application_DispatcherUnhandledException;
         application.Run();
  
      }
  </code></pre>
  
  <p>With the associated method:</p>
  
  <pre><code>static void application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
          {
              throw new NotImplementedException();
          }
  </code></pre>
  
  <p>When ever I throw an exception anywhere in the code it is picked up by the VS2013 debugger rather than being handled in the UI.</p>
  
  <pre><code>throw new Exception("TEST");
  </code></pre>
  
  <p>Can anyone suggest what I may be doing wrong?</p>
  
  <p>Thanks in advance.</p>