Is there a way to use Debug.WriteLine in a release build without defining DEBUG?
Debug.WriteLine
DEBUG
No. If you don't define the DEBUG preprocessor symbol, any calls to Debug.* will be removed by the compiler due to the [Conditional("DEBUG")] attribute being applied.
Debug.*
[Conditional("DEBUG")]
You might want to consider Trace.WriteLine or other logging techniques though.