By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,081 Members | 861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,081 IT Pros & Developers. It's quick & easy.

Debug or Release mode ?

P: n/a
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.
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JezB wrote:
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
Nov 17 '05 #2

P: n/a
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

"JezB" <je***********@blueyonder.co.uk> escribió en el mensaje
news:OO**************@TK2MSFTNGP14.phx.gbl...
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.

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.