Search code examples
c#.netvisual-studio-2010compact-frameworkwindows-ce

What do we need to do to prepare ourselves for porting an old Compact Framework app to CF 3.5?


We want to upgrade our handheld WindowsCE / Embedded CE executable. We can go no further/newer than CF 3.5 due to constaints of the targeted devices.

We'd really like to get off .NET 1.1 and being forced to develop in XP Mode.

So what do we need to do in order to open said project in Visual Studio 2010, using CF 3.5? We are on Windows 7. IOW, what do we need to install and configure before proceeding? I see no "Compact Framework" project in Visual Studio. I realize it is basically a Windows Forms app, but surely it needs to know that it is constrained by the compact framework stripped down subset of .NET...

Would setting Project > Properties > Application > Target Framework to ".NET Framework 3.5 Client Profile" (or simply ".NET Framework 3.5") suffice? The "install other frameworks..." link doesn't point to anything CE or CF-specific that I can see...?


Solution

  • Here's a great way to start, Clay:

    After installing VS2008 Professional, go out and get your Service Pack 1 installed.

    Reboot.

    Now go out and get the .NET Compact Framework 3.5.

    Reboot.

    If you're having fun with the reboots, you can always snag the Power Toys for .NET CF3.5 and reboot again.

    Instead of simply "double clicking" your old .NET 1.1 project to have it open in VS2008, I'd suggest first opening VS2008 and creating a new test project for Mobile Devices.

    If your project uses an SQL connection (like what I've seen in the past), add the reference to System.Data.SqlClient to this test project and make sure you are able to connect across your network.

    Once you can connect to your SQL Server, the conversion wizard may or may not work with your older VS project.

    Definitely make a backup before you let anything convert your old project!

    If it does not, you can simply go into the code of your old project, copy everything, and paste it into your new project.

    VS2008 uses partial classes, so the code for the GUI (control initializations) is all stored in Form1.Designer.cs. If your .NET 1.1 code has this code shown in the Form's constructor (public Form1() routine), you may need to hand Cut-N-Paste bits and pieces from one project to the other's Designer section.

    The Wizard might be able to handle all of that for you, but if it fails it can be hard to tell what the Wizard screwed up.

    So, try the Wizard first with a backup copy of your code. If that version isn't doing very well, make a second backup of your code and manually go in to change it.