DEBUG vs RELEASE and assembly distribution

I create and distribute the assembly to other developers. I am distributing the Release version of my assembly (and not debugging). In one of my build classes, I have code to run only in debug mode, using

#if DEBUG
    Console.WriteLine("Debug");
#else
    Console.WriteLine("Release");
#endif

If other developers reference my build from their project and run their project in debug mode, will my debug only conditionally run or not?

+4
source share
1 answer

If other developers reference my build from their project and run their project in debug mode, will my debug only conditionally run or not?

No, since it was Console.WriteLine()never compiled in Release mode due to a preprocessor restriction.

MSDN has something to say about this:

# #if, , , #endif, , ... ...

, , .

+10

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


All Articles