How can I get the running mode ?

  • Thread starter Thread starter xTroLL
  • Start date Start date
X

xTroLL

Hi,

I want to get the running mode (DEBUG or RELEASE) of my application ? Somebody can help me ?

xTroLL


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
 
I'm already trying that. But it's not that I want.

In my application, I want to get the type of the compilation use to put it
on a listview

That means : Data application name - Data application value

exemple:
DEBUG - 1.0.882.19234 or RELEASE - 1.0.882.19234

I want that for an About form

PS : Sorry if my english isn't very good
 
xTroll,
If you are still looking for an answer, here it is.

A preprocessor directive is performed by the compiler at compile time. The
following snippet works -

#if DEBUG

Console.WriteLine("Debug Version!");

#else

Console.WriteLine("Release Version!");

#endif



It works because DEBUG is set to true when you compile your app in Debug
mode with VS.NET (think of DEBUG as a variable the compiler uses while
compiling the app. You can define your own compile level variables by the
#define keyword. Such as -

#define pi 3.14

All the compiler does is find all the places where the symbol pi is in your
code (not in string literals though) and replaces it with the literal 3.14.



Hence, DEBUG is replaced with the literal true when compiling in debug mode.



Take care.
 
Back
Top