Console.WriteLine失败但OutputDebugString工作......为什么 [英] Console.WriteLine fails but OutputDebugString works... why
问题描述
您好,
我在Compact Framework 3.5下构建了一个简单的控制台应用程序
I built a simple Console application under Compact Framework 3.5
Console.WriteLine(" Hello) world"); 无法输出到调试串口,但如果我使用
OutputDebugString 来自coredll,文本显示在端口上。我错过了什么?
Console.WriteLine("Hello world"); fails to output to the debug serial port, but if I use instead OutputDebugString from coredll, the text shows on the port. What am I missing?
我的CE图片中是否有某些内容未启用? (我在PB中,在命令shell和命令处理器和控制台窗口下)。
Is there something in my CE image not enabled? (I have in PB, under the command shell the command processor and the console window).
或者VS解决方案中是否有设置指示Console映射到调试串口?
Or is there a setting in the VS solution to instruct Console to map to the debug serial port?
Thx
推荐答案
这是预期的。 Console.Writeline写入控制台窗口而不是调试串行端口。我不认为* Windows Mobile有一个控制台,所以这个功能仅在Windows CE中有用。
That is as intended. Console.Writeline writes to a console window not to the debug serial port. I don't *think* Windows Mobile has a console, so this function is only useful in Windows CE.
您可以编写一个调试监听器,将Console.Writeline路由到调试。不过,我没有在CF中试过这个,所以我不是100%肯定它会在这里工作。 http://support.microsoft.com/kb/815788
You may be able to write a Debug Listener that will route Console.Writeline to debug. I haven't tried this in the CF, though, so I am not 100% sure it will work here. http://support.microsoft.com/kb/815788
-PaulH
这篇关于Console.WriteLine失败但OutputDebugString工作......为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!