I need the following logic
#if (DEV || QA || RELEASE)
//add when dev or qa or release configuration
#endif
Is it possible in c#?
I need the following logic
#if (DEV || QA || RELEASE)
//add when dev or qa or release configuration
#endif
Is it possible in c#?
#define DEBUG
#define MYTEST
using System;
public class MyClass
{
static void Main()
{
#if (DEBUG && !MYTEST)
Console.WriteLine("DEBUG is defined");
#elif (!DEBUG && MYTEST)
Console.WriteLine("MYTEST is defined");
#elif (DEBUG && MYTEST)
Console.WriteLine("DEBUG and MYTEST are defined");
#else
Console.WriteLine("DEBUG and MYTEST are not defined");
#endif
}
}
Here simple code how to do it. You can read full documentation on C# Preprocessor Directives
Yes. Quoting the
#if
documentation on MSDN: