Can’t find PInvoke DLL ‘sqlceme35.dll’

I was working with a Windows mobile application that uses SQL Server Compact. After upgrading to Visual Studio 2008 SP1 and SQL Server Comapct 3.5 SP1 I got MissingMethodException, Can’t find PInvoke DLL ‘sqlceme35.dll’. The problem is that the native DLL is not installed. I tried various solutions to no avail, and the only one that worked for me was to install the missing DLL manually. It is included in a CAB file located under C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\<platform>\<processor>, but which platform and processor is the right one? I found the answer here: http://forums.microsoft.com/technet/showpost.aspx?postid=2594381&siteid=17. All Windows Mobile 5 and above devices are using sqlce.phone.wce5.armv4i.cab, so that’s the one you need to install. (So platform is wce500 and processor is armv4i.)
Configure a shared folder in the emulator and copy the cab there. On the emulator device, open the cab and it installs.
Advertisements

One thought on “Can’t find PInvoke DLL ‘sqlceme35.dll’”

  1. This particular article from you really helped me. I was facing this same problem and your suggestion solved it for me.
    I’m new to mobile development. Can you tell me how I can make VS2008 install sqlce.phone.wce5.armv4i.cab instead of the other version it is installing? Basically how can I control what VS installs on the device (emulator or physical)?
     
    Thanks in advance,
    Jairam

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s