I am new to C# and Visual Studio, and this may be a silly question but I do have to find an answer. My question is is it possible to differentiate debug and release builds in such a way the certain lines of code(in my case MessageBox.Show(…)) are compiled if I build under Debug mode, but are left out if I build under Release mode?
Share
Wrap the lines of code in
#if DEBUGstatements:If you want to do different things in release then you can have:
Source