Debug Output to Visual Studio

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!
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top