telling if compiled in debug

  • Thread starter Thread starter Brian Henry
  • Start date Start date
B

Brian Henry

In C++ you can tell if a program iscompiled as debug or release with special
tags... if the compiler is compileing in release mode it will include the
code in the release tag only and in debug mode the debug code only... so you
can have something like this

void main(void)
{
#RELEASE
cout >> "Release compiled";
#ENDRELEASE
#DEBUG
cout >> "Debug compiled";
#ENDDEBUG
}

that of course is just a psuedo code example, is there any way to do this in
VB.net? thanks
 
Brian Henry said:
In C++ you can tell if a program iscompiled as debug or release with
special tags... if the compiler is compileing in release mode it will
include the code in the release tag only and in debug mode the debug
code only... so you can have something like this

void main(void)
{
#RELEASE
cout >> "Release compiled";
#ENDRELEASE
#DEBUG
cout >> "Debug compiled";
#ENDDEBUG
}

that of course is just a psuedo code example, is there any way to do
this in VB.net? thanks


#If DEBUG Then
#Else

#End If

#Debug is defined at project level in the configuration settings in the
project properties. You can aloso define other constants in your code. See
"conditional compiling" in the docs.
 
Back
Top