Debug or Release mode ?

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

Any way I can programatically test whether my (c#) code is running in Debug
or Release mode ? I want to load a smaller dataset when running in debug,
for testing purposes.
 
JezB said:
Any way I can programatically test whether my (c#) code is running in
Debug or Release mode ? I want to load a smaller dataset when running
in debug, for testing purposes.

there is "conditional compilation":

#if DEBUG
// some code that is only compiled/executed in debug-mode
#else
// some code that is only compiled/executed in release-mode
#endif

Hans Kesting
 
You can use the DEBUG conditional compilation constant:

#if (DEBUG)
// This is only executed in Debug configuration

#endif
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
Back
Top