Strange Exception behavior

  • Thread starter Thread starter Steve Long
  • Start date Start date
S

Steve Long

I'm working on a project in VB.NET and when a line of code is executed that
throws a nullreferenceexception or some other type of exception, the runtime
just jumps to some other line of code(seemingly unrelated to the line that
caused the exception) instead of crashing and throwing up an exception
dialog. Has anybody else seen this type of behavior and if so, is this a bug
or is it just my screwed up project.

Thanks in advance

Steve
 
* "Steve Long said:
I'm working on a project in VB.NET and when a line of code is executed that
throws a nullreferenceexception or some other type of exception, the runtime
just jumps to some other line of code(seemingly unrelated to the line that
caused the exception) instead of crashing and throwing up an exception
dialog. Has anybody else seen this type of behavior and if so, is this a bug
or is it just my screwed up project.

Can you post the complete exception message + callstack?
 
Steve Long said:
when a line of code is executed that throws a nullreferenceexception
. . . the runtime just jumps to some other line of code (seemingly
unrelated to the line that caused the exception) instead of crashing
and throwing up an exception dialog.

"... the runtime jumps ..." - exactly what do you mean?

If you mean the Visual Studio IDE, make sure that you've [completely]
rebuilt the [dll] solution - it could be that the dbeuggin information is
out of step with the actual dll, so the IDE gets touch confused.

HTH,
Phill W.
 
Well, by jumping, I mean that when the IDE hits a line of code that causes
an exception to be thrown, (I know that because I can place a try block
around it which I did after it exhibited this stupid behavior), the next
line of code that gets executed is a line of code in an event handler for
one of the controls in my project. This event code is what would run when
the form is activated. So, to me this means that the form is getting send to
the front after the exception which causes the event code to activate. This
behavior continues whenever a line of code gets executed that causes an
exception to be thrown. What I would expect, however, is that the exception
would cause the IDE to either break at that line or cause the project to
crash due to an unhandled exception.

Perhaps is does need to be cleaned and rebuilt. I'll try that. I hope I made
sense there.

Steve


Phill. W said:
Steve Long said:
when a line of code is executed that throws a nullreferenceexception
. . . the runtime just jumps to some other line of code (seemingly
unrelated to the line that caused the exception) instead of crashing
and throwing up an exception dialog.

"... the runtime jumps ..." - exactly what do you mean?

If you mean the Visual Studio IDE, make sure that you've [completely]
rebuilt the [dll] solution - it could be that the dbeuggin information is
out of step with the actual dll, so the IDE gets touch confused.

HTH,
Phill W.
 

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

Back
Top