Reputation: 19122
I am setting up a WPF app with Entity Framework 4, using SQL Compact 4 as the data store. I have the files and the references set up for a SQL Compact 4.0 private deployment (per this MSDN article).
However, with SQL Compact 3.5, I had to add configuration entries to the App.config file (see this blog post and this article). I can't find anything on whether similar entries are required to use SQL Compact 4 with EF4 in a desktop app.
So, here's my question: Do I have to add special entries to App.config in order to use SQL Compact 4 with EF4? If so, can you point me to an article or blog post that shows them? Thanks for your help.
Upvotes: 3
Views: 2885
Reputation: 19122
Found the answer in this blog post by Erik Jensen:
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0"
invariant="System.Data.SqlServerCe.4.0"
description=".NET Framework Data Provider for Microsoft SQL Server Compact"
type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1,
Culture=neutral,
PublicKeyToken=89845dcd8080cc91"/>
</DbProviderFactories>
</system.data>
Thanks, Erik!
Upvotes: 2