简体   繁体   中英

Windows CE Console output converting strings

I created a C# console application running on a Windows CE device. I have one line of code in the program so far:

Console.WriteLine("Hello World");

Output on Screen: 11

The 11 is the length of the string, so is something converting my string to a character array or something?

I am using the SDK created from the BSP to target my device. In addition, the BSP includes both .NET 2.0 and .NET 3.5 for the OS, and I'm using Visual Studio 2005 for my console application.

Has anyone ever seen this before in a .NET console app? Thanks.

UPDATE: I tried to create a basic Windows Forms app and run that on my device. This time I got an actual error "System.Windows.Forms dll cannot be found", so that indicates to me that .NET is not installed correctly. I have it included in the Platform Builder catalog, so I'm not sure what else might be missing. Any ideas?

I've definitely never seen this, and I've seen a lot of CF behaviors.

First, don't put CF 2.0 and 3.5 in the OS. Ever. They don't coexist in an OS image project peacefully due to SYSGEN overlaps, plus it's unnecessary as the 3.5 runtimes can load and run 2.0 binaries.

You're certain that your only code is that one line? You're certain that you're runnign the app that is the code you're seeing (ie it's not running an old or different version by mistake)? Are you at a breakpoint when this happens?

I finally got it working, but I'm still not sure what the exact issue was.

The "fix" was to start with a clean install of Windows XP, Visual Studio 2005, and Windows Embedded CE 6.0 with all the latest QFE's.

After a rebuild of the OS image, both of my test applications started working as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM