Possible Duplicates:
Conditions when finally does not execute in a .net try..finally block
In C# will the Finally block be executed in a try, catch, finally if an unhandled exception is thrown ?
At http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java#Finally_Blocks_and_Uncaught_Exceptions
Says that finally block dont runs always. Its wrong, right?
The ECMA standard for the CLI (from which C# derives its exception features) states that exceptions are handled in a two-pass search of the stack.[13] The first pass attempts to locate a matching catch block, and terminates the program if none is found. Only if a matching catch block is found does the second pass execute, which runs the intervening finally blocks. This allows the problem to be diagnosed without the program state first being modified by the finally blocks; it also eliminates the risk that finally blocks may have undesirable side-effects when the program is in an unknown state (such as corruption of external data, or throwing further exceptions).
But, i dont need a catch to finally executes
static void Main()
{
try { throw new Exception(); }
finally
{
Console.WriteLine("1");
}
}