Ok, I realize that the question sounds ridiculous. Why would you wanna debug in release mode? I'm trying to implement an ILogger interface that when implemented, provides a facade for logging (obviously). For the most part, that facade writes out to enterprise library -- so it already has a Debug method with it's own configuration. The problem is that I simply add Debug.WriteLine("msg") line to the facade in addition to it's normal behavior of writing out to a file, when I build it in Release mode, those debug statements don't get compiled with it so it won't write to the console when using that library from a different project, even if that project is built in debug.
What I would like is to set up this facade so that regardless of how it is built, all Logger.Debug messages will be output to the window and not just the file generated by MEL. Can I just set up the System.Diagnostics object to always compile, or is there a way to set up enterprise library to use the output as a configured listener?
You can use Trace.WriteLine
instead. Just make sure that TRACE
is defined in the Release settings (it is by default).
Technically speaking, you could make DEBUG
defined in Release mode, either via project settings or explicitly:
#define DEBUG
But it would be weird.
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