unhandled .NET exception

R

Ragid

I get in the run an unhandled .NET exception message box saying:"The
specified cast is not valid".
How can I know where is that error comes from?
Regards
Ragid
 
C

Cor Ligthert[MVP]

You should not handle this error, you should solve this error. It is simple
a code error not a runtime error.

Cor
 
P

Pavel Minaev

I get in the run  an unhandled .NET exception message box saying:"The
specified cast is not valid".
How can I know where is that error comes from?

Run your program under the debugger (e.g. in VS). It should break at
the line which throws the exception, so long as your code doesn't
catch it (if you get the stock exception reporting dialog, then you
obviously don't).

You might also want to check settings in "Debug" -> "Exceptions", see
if you have the checkbox for "unhandled CLR Exceptions" on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top