The following has been edited. Hans seems to have retracted his answer, but his questioning has helped me to narrow down the problem statement:
Extra Clarity
- I do not want to modify the behavior of Ctrl+C.
- I'm not looking for a work around.
- I simply want the debugger to NOT break when Ctrl+C is pressed during a debugging session.
Please note that the following example is contrived. It's just to demonstrate the behavior. I changed the ReadKey line as it was distracting people.
Debug (run) the following program:
class Program
{
static void Main()
{
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
}
}
Press Ctrl+C. The debugger will break as if you set a breakpoint on the Sleep line.
How do you turn this off? I don't want the debugger to break at all for Ctrl+C.
This doesn't happen at home with VS2008 Pro.
I have now tried it with both VS2008 Express and VS2010 Express (the only editions I can test it with easily) and they all do it. This has led me to believe that either it's an Express behavior, or that there is a setting somewhere to toggle it on/off.
- Is there a setting to turn this on/off in any version/edition?
- Does this setting exist in VS2008, VS2010, or both?
- Is the setting exposed in the Express editions?
- Is my instance of VS2008 Pro unique? Is the setting something that was exposed in an old version of Visual Studio that has carried over (I have carried over VS settings through many new versions).