Search code examples
entity-frameworkvisual-studio-2013sql-server-ce

using EntityFramework 6 with SQL Server Compact 4


I am developping an application using Entity-Framework and Sql Server Compact 4 in a Visual Studio 2013 project. Here is the list of add-ons I installed via NuGet :

  • Microsoft.SqlServer.Compact 4.0.8876.1
  • EntityFramework 6.1.3
  • EntityFramework.SqlServerCompact 6.1.3

Then I want to add an ADO.NET Entity Data Model ("Code First from database"). I choose a sdf file that I already have created with SQL Server Compact Toolbox. The Wizard find it and generate a connection string

Data Source=E:\[...]\myDBtest.sdf

Then I click "Next >", the Wizard becomes gray, freezes a few seconds and then closes itself without showing the following step. At the end, it did not generate anything into my project.

I tried to rebuilt the project before adding the ADO item. And I even tried to reboot the computer ... with no more success.

Any suggestion or same experience ?


Solution

  • Of course you can use Db First with EF and SQL Server Compact. In order to avoid the error, install the latest Visual Studio Tools for EF (6.1.3) https://www.microsoft.com/en-us/download/details.aspx?id=40762