I am creating and distributing an assembly for other developers to use. I am distributing the Release version of my assembly (not the debug). In one of the classes of my assembly, I have code set to run only in Debug mode using
#if DEBUG
Console.WriteLine("Debug");
#else
Console.WriteLine("Release");
#endif
If other developers reference my Assembly from their project and run their project in Debug mode, will my Debug only conditional run or not?
No, because the
Console.WriteLine()
was never compiled in Release mode due to the pre-processor constraint.MSDN has more to say on this:
Also, it's not correct to think of it as being removed from the assembly as it was never present in the first place.