Archive for the ‘Windows Mobile’ Category.

Demo days (CONDG meeting, December 14, 2009)

The Central Ohio .NET Developers Group held their final meeting of the year last night at the Microsoft office in Polaris. Four people gave short demos of Xbox, Zune HD, Windows Mobile, and iPhone, and talked about developing for each platform.

The highlight of the evening was my name being drawn as winning the year’s final and perhaps most craptastic door prize, which I then gave to my coworker who was attending the meeting with me. He is into free t-shirts.

2009-12-15 09.13.18

NetCFSvcUtil.exe error in Windows 7

I have been using Windows 7 for a while now, and always had to keep my Windows XP dev machine handy to help out with my Windows Mobile software development.

It turns out that the NetCFSvcUtil application included in the .NET CF Power Toys did not get along with Windows 7 (neither the RC or the RTM bits), as it gave a cryptic error message of “An error occurred in the tool”.

So just for giggles, I decided to see if there were any updates, and lo and behold, I found a blog post from Habib Heydarian with an updated application:

NetCFSvcUtil.exe and Windows 7

Now I can happily generate the client code on my Windows 7 machine.

Cannot enable networking in Windows Mobile emulator on Windows 7

So you are using a new Windows 7 installation and developing a Windows Mobile application, and you have been using it just fine on another dev box or in an earlier version of Windows. You deploy your application, and it needs to communicate over the internet, so you go into the Network tab of the Emulator Properties and enable the network adapter.

Only this time, it comes up with an error message about installing Virtual PC 2007.

And then you find out that Virtual PC 2007 does not play nicely with Windows 7.

Well it all has to do with Virtual Machine Network Services. Here is a blog post from Brian Peek on how to solve the problem:

Windows Virtual PC and the Microsoft Device Emulator

System.MissingMethodException error in System.Data.SqlServerCe

After getting the new development machine up and running for the most part, I started once again to work on the web and client projects that we are going balls to the wall to get finished.

And of course, a roadblock was hit. On the Windows Mobile client, I got through most of the requisite re-referencing and compile errors that inevitably pop up when doing something like this. This client uses the Microsoft Synchronization Services to sync it’s local SQL Server Compact Edition database to our central SQL Server database.

When trying to create a new ServerSyncProviderProxy, the following error is being thrown:

System.MissingMethodException: File or assembly name 'System.Data.SqlServerCe,
Version=3.5.1.0, Culture=neutral, PublicKeyToken=3BE235DF1C8D2AD3', or one of
its dependencies, was not found.

After much headbanging, trial and error on both the 5.0 and 6.0 emulator and on an actual device, Google and Server Overflow searching, and staring at the code, we finally figured out what the problem was. As it turns out, I must have installed the SQL Server Compact Edition Service Pack 1 on my previous machine, and those references were saved and somehow survived in the project. On my new machine, there was a version of SQL Server Compact Edition that was installed by some component (Visual Studio 2008, Windows Mobile SDK, etc.), so to me everything looked OK. However, after installing the SQL Server Compact Edition SP1 on the computer, the error magically went away on the emulator.

As an aside, I tried to put the code on the handheld that it had not worked on previously, and it still did not work. After inspecting the error output, which was different, I found that I needed to redeploy the new SQL Server Compact Edition SP1 Windows Mobile sqlce.ppc.wce5.armv4i.CAB file on the device, unpack it (which overwrote the previous SQL Server CE files on the device), and then all was well.