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.
Do this and any application using SQL Compact 3.5 will happily run on Windows 64bit as a WOW Application.