3

I created a winforms app with Sqlserver ce 4.0.

I am using nuget to get the sqlserver ce 4.0 package.

After I compiled, I will get all the sqlserverce dll ready for me to distribute.

The files are: System.Data.SqlServerCe.dll System.Data.SqlServerCe.Entity.dll amd64 x86

But I get this error:

Unable to find the requested .Net framework data provider

Thank you.

Alvin
  • 8,219
  • 25
  • 96
  • 177
  • Solved: http://stackoverflow.com/questions/2540784/using-entity-framework-with-an-sql-compact-private-installation/2542055#2542055 – Alvin Aug 03 '12 at 09:58

1 Answers1

0

I resolved this issue by adding the following block to application config file:

  <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>
  </system.data>
Boris Zinchenko
  • 2,142
  • 1
  • 24
  • 34