Check in Code if in Debug or Release mode

Posted on: Fri Apr 30 11:28:22 -0700 2010. Updated on: Fri Apr 30 11:31:18 -0700 2010.
Category: DotNet

In c sharp it is easy to check if the code being executed is currently being run in debug or release mode:

#if DEBUG
// code goes in here
#else
// other optional code
#endif // dont forget this!

You can also use the RELEASE keyword to check if you are in release build mode.

Comments:

Add a Comment:

simple_captcha.jpg
(human authentication)


Ads

Categories

About

Random foliage

This website is meant to be a reference for ASP Dot Net developers. The entries are a compilation of things I've figured out how to do and that I deem useful to keep of track for future reference. Assumptions: web development with: C Sharp (vb sucks), visual studio 05/08, .net 3.5, meant for programmers. Written by: James Reategui.