According to the accepted answer on this question:
When the application is compiled in the release configuration,
the Debug elements will not be compiled into the code.
Do the argument expression evaluation side effects of Debug.WriteLine() (and similar) happen in release builds? I'm not sure what "Debug elements" really means.
This is easy enough to try yourself:
class Program
{
static void Main(string[] args) {
int i = 0;
Debug.WriteLine(i++);
Console.WriteLine(i);
Console.ReadLine();
}
}
In Debug Mode the console prints 1. In Release Mode the console prints 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With