« Going to TechEd EMEA 2008 | Main | The only way to predict the future is to invent it »

Monday, November 10, 2008

SqlCE and Entity Framework maybe broken on x64

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:

image

and choose “Configuration Manager…”. In the next dialog click the dropdown in the Platform-column.

image

In the popup you can create a new platform (choose x86). That should be it.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8342fe72c53ef010535e7fefb970c

Listed below are links to weblogs that reference SqlCE and Entity Framework maybe broken on x64:

Comments

That's frikking stupid!

Thanks for the info though :)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment