This is a behavior I noticed several times before and I would like to know the reason behind that. If you run the following program under the (Visual Studio 2008) debugger, the debugger will keep breaking on the throw
statement no matter how often you continue debugging. You have to stop debugging to get out there. I would expect that the debugger breaks once and then the process terminates as it happens if you run the program without the debugger. Is anybody aware of a good reason for this behavior?
using System;
namespace ExceptionTest
{
static internal class Program
{
static internal void Main()
{
try
{
throw new Exception();
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
// The debuger will never go beyond
// the throw statement and terminate
// the process. Why?
throw;
}
}
}
}