Code depending on the type of assembly?

I am using Visual C # Express 2008. I want a special command to be executed only in the Release builds - this command should not be executed when creating and running Debug versions. Is it possible to implement the code depending on my build type (Debug or. Release)?

For instance:

if(??buildtype?? == "Release")
{
 //... special command ...
 MessageBox.Show("RELEASE version");
}
else
{
//... normal command ...
MessageBox.Show("debug release");
}
+3
source share
2 answers
#if DEBUG
  // Commands that should run in debug builds.
#else
  // Commands that should run in release builds.
#endif
+11
source

There are also some useful answers in this question: #ifdef in C #

+1
source

Source: https://habr.com/ru/post/1730836/


All Articles