"S. Han" wrote:
I use Trace.Assert() through out my app and it's such a great way to
debug a program. My question is is there any way to redirect the
assertion pop-up to the command line output in my console
application?
Hi,
implement a class derived from System.Diagnostics.DefaultTraceListener.
override the Fail() method.
Then add tan instance of this class to the Trace Listeners collection:
Trace.Listeners.Add(new YourListener());
if you wish to totally redirect the Assertion to your trace listener,
remove the default listener:
Debug.Listeners.Remove("Default");
Trace.Listeners.Remove("Default");
A nice Article to that topic is here:
<http://www.codeproject.com/csharp/assert.asp?target=>
HTH,
Andy
--
To mail me directly, remove the NO*SPAM parts in
NO***********@gmx.netNO*SPAM