Is it possible for C # to execute certain line codes in the debug settings, and others in the release settings.
if #debug //run some lines of code else // run different lines of code
You can do something like:
#if DEBUG // Debug Code #else // Release Code #endif
I use this in WCF services to run it as a console application when debugging, but as a Windows service in the release
NTN, Rupert.
Read this blog post If youre using "#if DEBUG", Youre Doing It Wrong , the author suggests using System.Diagnostics.ConditionalAttribute:
System.Diagnostics.ConditionalAttribute
[Conditional("DEBUG")] private static void DebugMethod() { // Debugging code }