T
TC
I asked this question before, but didn't receive an answer, so I'll
try again.
When I get a runtime error in Debug mode, Visual Studio highlights the
line where the error occurred, then let's me debug the error and
resume execution. This is extremely useful. However, this feature
doesn't seem to work when the runtime error occurs in a class
constructor (Sub New). In that case, Visual Studio does not show me
the line which generated the error, and I have to dig into the
InnerException to learn anything about what happened. This can make
debugging extremely frustrating.
In response to this behavior, I've learned to structure my code in a
way that avoids use of Sub New. However, I feel like that may be a
mistake. Therefore, I'd like to look more closely at this issue and
figure out exactly what is going on. I'd be grateful if anyone can
help me answer the following questions:
- First of all, are other people seeing the same thing, or is it just
me?
- Second, is this behavior documented or explained somewhere?
- Third, can I customize this behavior at all? Can I, for instance,
change a setting or add a compiler instruction to make the debugger
work the way I want?
-TC
try again.
When I get a runtime error in Debug mode, Visual Studio highlights the
line where the error occurred, then let's me debug the error and
resume execution. This is extremely useful. However, this feature
doesn't seem to work when the runtime error occurs in a class
constructor (Sub New). In that case, Visual Studio does not show me
the line which generated the error, and I have to dig into the
InnerException to learn anything about what happened. This can make
debugging extremely frustrating.
In response to this behavior, I've learned to structure my code in a
way that avoids use of Sub New. However, I feel like that may be a
mistake. Therefore, I'd like to look more closely at this issue and
figure out exactly what is going on. I'd be grateful if anyone can
help me answer the following questions:
- First of all, are other people seeing the same thing, or is it just
me?
- Second, is this behavior documented or explained somewhere?
- Third, can I customize this behavior at all? Can I, for instance,
change a setting or add a compiler instruction to make the debugger
work the way I want?
-TC