0

When I attempt to:

  1. Add a new ADO Entity Data Model
  2. Select EF Designer from database
  3. Select an existing database connection, include the connection string, and save it to app.config
  4. Do NOT copy/modify the connection (I tried this with the copy and with a database that as already in my project)

I get an error

Your project references the latest version of the Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for your data connection

I've been trying for hours to get this configuration to work without success. I am using the following:

  1. Windows 7 64-bit
  2. Visual Studio 2012 Express (C# application)
  3. SQL Server Compact Edition 4.0 SP1 x64 ENU - I can't install the 32bit version on a 64-bit OS.
  4. Entity Framework 6.1.0 dated 3/17/2014
  5. EntityFramework.SqlServerCompact 6.1.0

I have tried uninstalling and re-installing components 3-5 multiple times.

I have the following in the app.config file (omitted the <entityFramework> section):

<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.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </DbProviderFactories>
<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
        <parameters>
            <parameter value="System.Data.SqlServerCe.4.0" />
        </parameters>
    </defaultConnectionFactory>
    <providers>
        <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        <provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
    </providers>
  </entityFramework>
</system.data>

I have rebuilt the solution multiple times with no errors. The application starts.

I have rebooted multiple times.

I have confirmed that the project is not referencing System.Data.Entity.

Please tell me I'm missing something simple.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
James
  • 954
  • 2
  • 13
  • 27
  • Have you had a look at [ErikEJ's "Everything SQL Server Compact" website?](http://erikej.blogspot.ch/) - he has an extensive collection of tips, tricks, article, walkthroughs, demos and tools for SQL Server CE development. E.g. see [Using SQL Server CE 4.0 with Entity Framework and ASP.NET](http://erikej.blogspot.ch/2010/11/using-entity-framework-with-sql-server.html) - does that help at all? – marc_s Apr 26 '14 at 06:42
  • That's a good read; however, I cannot find an answer there. After some additional troubleshooting, it appears that the problem is related to a x64 build/configuation. I can get EF6 to work with SQL CE 4 SP1 on VS2012 Express as long as there are no 64bit projects in the solution. I don't think there is an issue with VS2012 Express at this point. – James Apr 26 '14 at 13:21
  • I've decided to switch back to 32bit for this project which makes EF6 and SQL CE 4 happy. Given that SQL CE has been discontinued, I doubt it will there will be a fix to support 64bit programming with EF6. – James Apr 28 '14 at 12:47

0 Answers0