Debug or Release mode ?

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.
 
H

Hans Kesting

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
 
C

Carlos J. Quintero [.NET MVP]

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
 

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

Top