A customer contacted me a few weeks ago to tell me that their managed code application failed when running on Windows CE 6.0 with the .NET CompactFramework 3.5. It ran fine on Windows CE 5.0 with .NET CF 3.5 and on Windows CE 6.0 with .NET CF 2.0.
The problem was really odd because it showed up in different ways, but usually there was an error message similar to:
File or assembly name 'System.Data.SqlServerCe, Version=, Culture=neutral, PublicKeyToken=3BE235DF1C8D2AD3', or one of its dependencies, was not found.
The message would be different at different times, or possible different version of the application. That helped lead to some confusion for us. I falsely assumed that a file or assembly name or one of its dependencies was not found. So we checked dependencies, but we couldn’t find any problems. As you can imagine the customer wasn’t very patient with us because they assumed that we left something out of the OS.
To add to the problem, we noticed that this message was preceded by a lot of Data Aborts. The Data Aborts were coming from many different places. So we worked on debugging the Data Aborts, but that actually fixed the problem. That is a debug build fixed the problem. We dug deeper and determined that a debug version of Coredll.dll fixed the problem.
My team and the customer searched for answers in many different ways. Time passed but we still didn’t have a good answer.
Then while reading the newsgroups this week I found a glimmer of hope in a question that someone asked. The question seemed odd and very unlikely. It went like this:
“I am using PXA270 based platform with WinCE 6.0 as OS. I tried to add Net CF 3.5 components in my image and tried to run simple Hello World application, but no luck.
My first question is: Do I need to implement SPI_GETPLATFORMNAME in my OEM_IOCTL to make it work”
My first reaction was that I couldn’t imagine how SPI_GETPLATFORMNAME could have anything to do with the problem.   But, I happen to know the engineer who posted the question, so I tended to believe that it was possible. Then in less than 24 hours, he responded to his own question with the answer. He had fixed his kernel to support SPI_GETPLATFORMNAME and his application began to work.
I also gave it a try and added support for SPI_GETPLATFORMNAME to my platform. Sure enough my customer’s application began to work very well.
The lesson here is that when porting a BSP from Windows CE 5.0 to 6.0 be sure to notice the information about the changes to IOCTL_HAL_GET_DEVICE_INFO and deprecated IOCTL_HAL_GET_DEVICEID and IOCTL_HAL_GET_UUID.
Copyright © 2009 – Bruce Eitman
All Rights Reserved