SQL Server Compact 4.0 private deployment with Entity Framework 6.0 and NuGet

deployment entity-framework-6 nuget-package sql-server-ce

Question

I have installed Entity Framework 6 and SQL Server Compact 4.0 in my standard-setup WPF project. All of the files required for the deployment of SQL Server CE are appropriately copied to theRelease a folder, whichSystem.Data.SqlServerCe.dll .

However, launching a project on a computer without SQL Server Compact installed results in errors.System.IO.FileLoadException .

My environment for development contains theSystem.Data.SqlServerCe.dll loading from the GAC. I discovered the following reference, which explains how dll version numbers work: http://technet.microsoft.com/en-us/library/gg213826.aspx

I assumed that the rendition ofSystem.Data.SqlServerCe.dll NuGet's assembly version is 4.0.0.0.

Thus, I made a manual alteration.System.Data.SqlServerCe.dll I copied the 4.0.0.1 file from the Private folder and used it as a reference in my project.System.Data.SqlServerCe.dll 4.0.0.1 to the manufacturing device

I've evolvedapp.config similar to:

  <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>

This exception is now occurring on my development machine:

The connection given is not of type 'SqlCeConnection'.

I receive on a production machineSystem.Data.Entity.Core.EntityException .

Is there a potential that NuGet and EF 6 could work with private deployment? Or do all the files in the x86 and amd64 directories need to be manually copied?

1
0
11/11/2013 7:16:19 PM

Accepted Answer

ZZZ_tmp
0
10/31/2014 6:23:08 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow