tags:

views:

55

answers:

2

Hello, I turned my pc on this morning, and when I started testing some apps, I noticed that no exceptions are thrown (no dialog or anything).

The code just stops executing and nothing happens!

Example:

private void Form1_Load(object sender, EventArgs e)
{
    throw new Exception("error");
    //anything below will not execute
}

visual studio doesn't show any error dialog, I also tried to run the .exe directly and nothing happens as well...

I tested it with .net 2.0, 3.5 and 4.0! All the same...

any idea whats wrong?

+1  A: 

Visual Studio: CTRL+ALT+E -> Enable "Thrown" under Common Language Runtime Exceptions.

Mau
It works now, but when debugging with visual studio... when I run the exe directly it doesn't throw the exceptions...
Bruno
It probably does, and the app probably gets killed. Catch the exception and show a dialog. Or switch from release top debug mode and you might get one for free.
Mau
A: 

I know of two possible reasons:

  1. You assigned an unhandled exception handler to your AppDomain that does nothing
  2. The code throwing the exception runs on a different thread

What does the Windows Application event log say?

Thorsten Dittmar
Event log says nothing. I just open VS, create a new project, add a throw new exception code and nothing happens... I installed a new virtual machine and if I run the code on the VM, it breaks as expected...
Bruno