Techniques in VB for Debugging vs Production Code

  • Thread starter Thread starter Sebastian
  • Start date Start date
S

Sebastian

Hi,
I'm coming from a C/C++ background and wondering if there's a
straightforward way to designate debugging code in a vb.net application?
I'm accustomed to setting up a Preprocessor macro "Debug()" in the
tradition of Steve McConnell, which will include or exclude chunks of
code depending on a debugging flag, or debugging level. So far the only
option I see open to me is if/then blocks. Anyone have any tips?
 
Sebastian said:
Hi,
I'm coming from a C/C++ background and wondering if there's a
straightforward way to designate debugging code in a vb.net application?
I'm accustomed to setting up a Preprocessor macro "Debug()" in the
tradition of Steve McConnell, which will include or exclude chunks of
code depending on a debugging flag, or debugging level. So far the only
option I see open to me is if/then blocks. Anyone have any tips?

You can do
#if Debug then

#else

#end if

to add code during debug session.
if you wanted to add an entire function then do:

#if Debug then DebugCode()
 
Back
Top