Developing .NET Compact Framework applications for Windows CE 4.2 Devices.
.NET Compact Framework v2.0 SP1 includes support for Windows CE 4.2 based devices. To date, Visual Studio 2005 does not provide managed 4.2 projects nor is there any support offerings for developing solutions targeted at 4.2 devices. The good news is the 5.0 projects work just fine with one exception, debugging is currently broken on x86 based devices. Below I outline the steps in creating and debugging a .NET Compact Framework v2.0 SP1 Hello World application.
Using Visual Studio
The steps below outline how to create and debug a hello world application using Visual Studio 2005. If your Windows CE device uses an x86 processor, see Using Command Line section.
1. Configuring the Development Environment
To successfully run and debug applications based on .NET Compact Framework 2.0 SP1 you will need to apply .NET Compact Framework 2.0 SP1 to your development environment. To update Visual Studio 2005 download the latest .NET Compact Framework 2.0 SP1 patch from https://www.microsoft.com/downloads/details.aspx?FamilyID=7befd787-9b5e-40c6-8d10-d3a43e5856b2&displaylang=en.
2. Creating the Hello World Project
- Open Visual Studio 2005 and create a new C# Windows CE 5.0 project by selecting Device Application from the New Project dialog.
- From the ToolBox drop a button on the form and add code below
- Add Code to button click MessageBox.Show("Hello World");
- The Windows CE 5.0 project will attempt to deploy the .NET Compact Framework 2.0 SP1 CAB files which are not designed for Windows CE 4.2. To disable deployment turn off Deploy the latest version of NETCF click on your projects properties by selecting the Property Menu and clicking on Properties. Then click on the Devices tab and uncheck Deploy the latest version of the .NET Compact Framework.
- Build the Hello World application by selecting Build Solution under the Build menu.
3. Setting up the Device
There are two ways to get NETCF v2 SP1 included on your 4.2 device, included in ROM by building ROM images using Platform Builder 4.2 or installed into RAM by deploying the .NET Compact Framework CAB file. See below for details
Including .NET Compact Framework v2.0 sp1 in ROM
- On the PC that includes Platform Builder apply the .NET Compact Framework 2.0 SP1 Update. For more information on the Platform Builder Update, see Windows CE Download Center
- Once the Update is applied, open the Workspace which contains the image to be updated.
- Remove .NET Compact Framework v1 from the list of included features
- Add .NET Compact Framework v2.0 SP1 from the Catalog.
Including .NET Compact Framework v2.0 sp1 in RAM
- Copy the matching CAB file from \Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\wce400\<<Processor>>\NETCFv2.wce4.<<proc>>.cab to your device
- Run CAB file on the device to install.
4. Connecting the Device to Visual Studio 2005
If your device connects to the PC using ActiveSync then make that connection now. To connect a WindowsCE device to Visual Studio 2005 without ActiveSync see: https://msdn2.microsoft.com/en-us/library/ms228708.aspx
5. Deploy and Debug Hello World
- In your Hello World application set a breakpoint at the messagebox.
- Type F5 to deploy.
- The code will stop at the breakpoint, type F5 again to continue to run the project.
Using Command Line To Debug
For x86 based devices, debugging will need to be done from the command line using mdbg. For more information on command line debugging see David Klines blog posting at: https://blogs.msdn.com/davidklinems/archive/2006/07/13/665023.aspx
Comments
Anonymous
August 08, 2006
tanks very goodAnonymous
August 08, 2006
Mark Prentice의 Blog에 보면 새롭게 Windows CE.NET 4.2 에서 Visual Studio 2005를 사용하여 디버깅하는 방법에 대해 잘 설명해 놓았습니다....Anonymous
August 09, 2006
You've been kicked (a good thing) - Trackback from DotNetKicks.comAnonymous
August 23, 2006
.NET Compact Framework v2.0 SP1 includes support for Windows CE 4.2 based devices. To date, Visual Studio...Anonymous
December 03, 2006
The comment has been removedAnonymous
December 03, 2006
The comment has been removedAnonymous
February 18, 2007
Mark Prentice의 Blog에 보면 새롭게 Windows CE.NET 4.2 에서 Visual Studio 2005를 사용하여 디버깅하는 방법에 대해 잘 설명해 놓았습니다.Anonymous
January 20, 2009
PingBack from http://www.hilpers-esp.com/640507-problema-con-vs-2005-yAnonymous
January 21, 2009
PingBack from http://www.keyongtech.com/468553-win-ce-4-2-aAnonymous
January 29, 2009
PingBack from http://www.adivor.it/forum/f57/ritornare-pseudo-desktop-desktop-windows-ce-12145/index2.html#post104282Anonymous
January 30, 2009
PingBack from http://www.adivor.it/forum/f57/ritornare-pseudo-desktop-desktop-windows-ce-12145/index2.html#post104349Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=mark-prentice-developing-net-compact-framework-applications-for