PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Debug Output to Visual Studio

Reply

Debug Output to Visual Studio

 
Thread Tools Rate Thread
Old 23-06-2007, 08:36 PM   #1
=?Utf-8?B?RGF2aWQ=?=
Guest
 
Posts: n/a
Default Debug Output to Visual Studio


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!

--
David

  Reply With Quote
Old 23-06-2007, 11:57 PM   #2
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

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


"David" <guiness@nospam.nospam> wrote in message
news:504086F3-97E4-4D61-96AF-B4B1840AD0AB@microsoft.com...
> 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!
>
> --
> David
>



  Reply With Quote
Old 24-06-2007, 02:02 AM   #3
=?Utf-8?B?RGF2aWQ=?=
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

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

  Reply With Quote
Old 24-06-2007, 02:36 AM   #4
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

> 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



  Reply With Quote
Old 24-06-2007, 05:54 AM   #5
=?Utf-8?B?RGF2aWQ=?=
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

"<ctacke/>" wrote:

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

>
> Why?


Because OutputDebugStringW works fine when debugging my unmanaged code.

David

  Reply With Quote
Old 24-06-2007, 01:28 PM   #6
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

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




"David" <guiness@nospam.nospam> wrote in message
news:C2E44808-A4A5-4DD8-8549-4A00C0277816@microsoft.com...
> "<ctacke/>" wrote:
>
>> > Even if it was a CF1 issue I'd still expect OutputDebugStringW or
>> > NKDbgPrintfW to work.

>>
>> Why?

>
> Because OutputDebugStringW works fine when debugging my unmanaged code.
>
> David
>



  Reply With Quote
Old 02-07-2007, 07:52 PM   #7
=?Utf-8?B?RGF2aWQ=?=
Guest
 
Posts: n/a
Default Re: Debug Output to Visual Studio

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

--
David

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off