1

Possible Duplicate:
Silent failures in C#, seemingly unhandled exceptions that does not crash the program

I'm sorry if this has already been discussed, but I really sarched for it and couldn't find an answer.

It happens on Visual Studio 2010, when working with Windows Forms Application.

The thing is it doesn't show me runtime errors when I execute it with "Start Debugging" options. It works fine on old projects that I have saved here, but when I start a new one, I have this issue. For example, I simpy start a new application and put this on Form_Load:

int a = 0; int b;
b = 4 / a;

If I run my application by pressing Ctrl + F5, it shows me normally the division by zero exception. But if i run it by pressing F5, it just ignores the error. It won't stop the application and point the error line, which it would normally do. And every other error is also being ignored. The errors happen when I run my application without debugging, but not when debugging.

I tested for both C# and VB.NET applications and had the same issue. I don't remember changing anything on VS config, does anybody know why errors aren't being shown to me on new applications??

Thanks.

EDIT:

Thanks, Jeff E. It's as shown on link: Silent failures in C#, seemingly unhandled exceptions that does not crash the program

I never knew errors aren't shown on Form Load. All the code I tried were on Form Load and Form Activated.

I'm sorry for my ignorance, thanks again everyone.

Community
  • 1
  • 1
kuroixxx
  • 11
  • 2
  • Have you tried restoring VS settings to default? You may have altered a setting that is causing this behavior. – Frazell Thomas Oct 29 '12 at 01:54
  • http://stackoverflow.com/questions/1583351/silent-failures-in-c-seemingly-unhandled-exceptions-that-does-not-crash-the-pr – Jeff Oct 29 '12 at 01:55
  • Just to be clear, what version of .Net are you targetting? – DeanOC Oct 29 '12 at 02:00
  • @kuroixxx can you please post the answer to your own question? This way people will know its solved and wont spend any time troubleshooting it. Thanks and good luck! – Jeremy Thompson Oct 29 '12 at 02:15

0 Answers0