title: Raising events in C# that ignore exceptions raised by handlers
body: <p>One of my pet peeves with raising events in C# is the fact that an exception in an event handler will break my code, and possibly prevent other handlers from being called, if the broken one happened to get called first; In most cases my code couldn't care less if somebody else's code that's listening to its events is broken.</p>
  
  <p>I created an extension method that catches exceptions:</p>
  
  <pre><code>public static void Raise(this EventHandler eh, object sender, EventArgs e)
  {
    if (eh == null)
      return;
    try
    {
      eh(sender, e);
    }
    catch { }
  }
  </code></pre>
  
  <p>Although this does mean my code carries on regardless, this method doesn't stop a first event handler throwing an exception and preventing second and subsequent handlers being notified of the event. I'm looking into a way of iterating through GetInvocationList to wrap each individual event handler in it's own try/catch, but this seems inefficient, and I'm not certain of the best way to do it, or even if I should be.</p>
  
  <p>Also, I'm really not comfortable simply ignoring the exception here (and neither's FxCop/Resharper for that matter); realistically what should happen to the exception in this case?</p>