title: Silent failures in C#, seemingly unhandled exceptions that does not crash the program
body: <p>In a winforms app, in a form's Load event, add the following line:</p>
  
  <pre><code>throw new Exception();
  </code></pre>
  
  <p>and run the application. It ran without a problem. This is called a silent failure, you can try to add messageboxes before and after, and you'll soon find out that instead of crashing the application, the throw statement just exits from the Load event.</p>
  
  <p>I'm sure there is no need to explain how ugly and dangerous this is. </p>
  
  <p>I was wondering nonetheless in the (probably history) reasons behind this terrifying behavior.
  I'm sure it's not a design decision, probably no-choice, or laziness. Does anybody know?</p>
  
  <p>Would be glad if anyone can point me to a list of events which may cause seilent failures too.</p>
  
  <p>Here's a snippet of my code - I have no idea how it might help - but, here it is:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Windows.Forms;
  
  namespace WindowsFormsApplication1
  {
      static class Program
      {
          /// &lt;summary&gt;
          /// The main entry point for the application.
          /// &lt;/summary&gt;
          [STAThread]
          static void Main()
          {
              Form f = new Form();
              f.Load += new EventHandler((x, y) =&gt; { throw new Exception(); });
              Application.Run(f);
          }
  
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  It seems it does not happend to everyone.
  I use: fw 3.5, winforms, vs 2008, vista x64, new clean project of winforms, with the code mentioned above.</p>