Debug Output to Visual Studio

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to get debug output sent from my CF1 application to the output
window in Visual Studio.

System.Diagnostics.Debug.WriteLine doesn't work. Calling OutputDebugStringW
or NKDbgPrintfW in coredll similarly produces no output.

I see this comment in OpenNETCF.Diagnostics.DebugMessage: "... applies only
to generic CE devices. Most commercial Pocket PC and SmartPhone devices do
not expose a debug port."

But I see output pertaining to my application's execution (first chance
exceptions, etc.) in the VS output window.

Can anyone shed any light?

Thanks!
 
You've not said what version of Studio, but I know Studio '03 did not have
the ability to pipe messages back to Studio. '05 definitely does (I know
for certain with the CF 2.0 projects anyway - I assume the CF 1.0 ones also
work).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
I'm using VS 2005, and the device is connected via USB.

Even if it was a CF1 issue I'd still expect OutputDebugStringW or
NKDbgPrintfW to work.

David
 
Even if it was a CF1 issue I'd still expect OutputDebugStringW or
NKDbgPrintfW to work.

Why? Thos get routed to the device debug port, which is platform dependent.
CE devices usually run it out a serial port. There's nothing that says that
NKDbgPrintfW should pipe its output to CoreCon and back to Studio. I've
never seen it work in a Pocket PC/WM device (I wrote the call, and the
caveat, in the SDF for vanilla CE development).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Interesting. All I can guess is that the CF projects use a different
mechanism of communicating back to Studio (no idea why they would do that,
but it appears they must). I know it works with CF 2.0 (and I could swear
it did with CF 1.0 in Studio '05).


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
I just noticed that if I debug an unmanaged DLL that is loaded by my managed
app, then all the managed app's calls to System.Diagnostics.Debug.WriteLine
show up in the VS2005 output window.

I guess I can use this as a workaround...
 
Back
Top