I’ve been running on a 64 bit version of Windows for the first time the past week, and while most things have worked fine I had one problem that I had a hard time figuring out. An existing project, that worked fine before the upgrade, refused to compile. I also upgraded it to SP1 of Visual Studio 2008, so there were two possible sources for problems.
In my project I have a local SQL Compact (CE) 3.5 database
I’m using the Entity Framework in my application.
The application compiled fine, but when I tried to to run it I got the following error:
"The specified store provider cannot be found in the configuration, or is not valid."
I first thought this was related to my newly installed Vista and to moving to Visual Studio 2008 SP1. But then I stumbled across the following article, where someone else was having the same problem:
While the post seemed to be dealing with the beta bits of SP1, it seems what it boils down to is that the provider for SQL CE is broken (missing) on x64. So what I need to do is to compile for x86 (32 bits) instead. “Runs natively in the 64-bit environment”, indeed! (borrowed from the SQL CE product page at microsoft.com)
Most of you probably know how to change this, but in case you don’t I’m including the instructions here. So in order to compile for x86 specifically (instead of “Any CPU” which is the default) you need to add a new configuration for that. The easiest way is to click on the dropdown in the VS menu:
and choose “Configuration Manager…”. In the next dialog click the dropdown in the Platform-column.
In the popup you can create a new platform (choose x86). That should be it.