Please consider the following scenario: I have a C++ file and we call that C++ code from the C#. In C++ file, there is a flag
#define HasFeature
I would like this flag to be undefined in the production code, and in only my test code I want to activate them. After the finalization of the test, I want it to be undefined again.
I know it is a compile-time feature and editing it in runtime won't be possible. I cannot convert the #define to something like class member because of another reason.
One thing that I can think of adding two files, in one of them the flag is defined and one of them the flag is undefined and in test.proj use the file with flag defined and production.proj use the file with flag undefined. Is that possible in Visual Studio? If so how can I do it? (Maybe using some feature in csproj etc.?)