SQL Compact 3.5 on a 64 bit Windows

SQL Compact is a great little database and highly recommended. However it was designed for use on small compact, hence its name, devices and that has some drawbacks. One of these is that it doesn’t run as a 64 bits application. And by default if you create a .NET application it is compile as “Any CPU” meaning it will run as a 64 bits application on a 64 bits version of Windows.

I, or I should say Ron Jacobs, ran into that using my SqlCeWorkflowPersistenceService because the sample/test application  was set to the default of “Any CPU”. The result is that the LINQ provider cannot load the runtime and a InvalidOperationException with message “Cannot open ‘WorkflowPersistenceDatabase.sdf’. Provider ‘System.Data.SqlServerCe.3.5′ not installed.” is the result. Now the fix is rather easy but it has to be done in the main program and that is to compile it for X86 instead of Any CPU.

X86

Do this and any application using  SQL Compact 3.5 will happily run on Windows 64bit as a WOW Application.

Enjoy!

One thought on “SQL Compact 3.5 on a 64 bit Windows

  1. Thanx for the tip. I didn’t understand why my test where falling on my machine, when using SQL Server CE. Spend several hours on it :(.

    Once I changed my test application to X86 my test didn’t fail anymore :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>