First Chance Exception:
AppDomain.CurrentDomain.FirstChanceException += CurrentDomainOnFirstChanceException;
private void CurrentDomainOnFirstChanceException(object sender, FirstChanceExceptionEventArgs firstChanceExceptionEventArgs)
{
if (firstChanceExceptionEventArgs.Exception is NullReferenceException)
{
}
}
Multiple first case. A run-time exception can damage the performance of your application, because exception handling is expensive. Especially in web applications. You can add this handler and look at certain exceptions of the first chance and try to avoid / fix them.
source
share