finally doesn't seem to execute in C# console application while using F5
问题 int i=0; try{ int j = 10/i; } catch(IOException e){} finally{ Console.WriteLine("In finally"); Console.ReadLine(); } The finally block does not seem to execute when pressing F5 in VS2008. I am using this code in Console Application. 回答1: The Visual Studio debugger halts execution when you get an uncaught exception (in this case a divide by zero exception). In debug mode Visual Studio prefers to break execution and give you a popup box at the source of the error rather than letting the