Trace.WriteLine (Urgent)

  • Thread starter Thread starter Peter Morris [Droopy eyes software]
  • Start date Start date
P

Peter Morris [Droopy eyes software]

Hi all

I have an app that is performing some very complicated operations at a
certain point. Sometimes this takes 45 seconds, sometimes (on the same
data) it takes 5 minutes. I'd like to try to track down the cause of this
problem but stepping through the code doesn't help much because

1) It is recursive so too hard to mentally work out what is happening
2) It doesn't give me an idea of time

I wanted to use Trace.WriteLine to try to help me to work it out where the
delays are but sadly this doesn't exist in CF2. Is there an alternative I
can use to display trace messages?


Thanks

Pete
 
You might look at the TextWriterTraceListener in the SDF - we use it
internally for a lot of this type of thing. It matches the same class name
in the FFx, so examples are easy to find if you need one.
 
Hi Chris

I'm confused! I don't get "Trace" in System.Diagnostics in CF2, and the URL
on MSDN that describes this class doesn't list CF as a supported platform.

Am I missing something?

Pete
 
Oh right. I ended up writing my own. My MemoryTraceListener keeps a buffer
of a certain size and then only dumps to file if an unexpected exception
occurs. It works very well.

Thanks for your time Chris, I appreciate it!


Pete
 
Back
Top