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:
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3422883&SiteID=1
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.
That's frikking stupid!
Thanks for the info though :)
Posted by: Jono | Wednesday, May 13, 2009 at 13:45
Frikking stupid indeed. You've saved me a couple hairs with the blog post. Thanks.
Posted by: Pete | Monday, September 07, 2009 at 05:23
tnx, Nicke! Too many problems with compilation under x64 ...
Posted by: w!ldc@t | Tuesday, October 06, 2009 at 22:48
Another way to solve the problem: http://blog.severinpankov.com/2010/01/unable-to-develop-sql-server-compact.html
Posted by: GiyaS | Friday, January 29, 2010 at 12:43
Any other alternatives out there? I'm using Visual Studio Express, which does not include a way to select a deployment platform.
Posted by: Alex Barrett | Sunday, March 28, 2010 at 06:58
Yeah, I tried this and still get an error. Using SQL Server Compact SP2 on a 64-bit Windows 7 machine.
Posted by: Jonathan | Thursday, December 16, 2010 at 01:17
Unfortunately it feels like SQL CE isn't a very high priority for MS.
Posted by: Nicke Andersson | Friday, December 17, 2010 at 12:23
I have been trying to figure this out for about 2 days now and this has finally helped me figure out the problem! THANK YOU SO MUCH!
Posted by: Xxf8xx | Tuesday, December 20, 2011 at 23:16