Page 1 of 1

The 'Instance' member of the Entity Framework provider type 'Devart.Data.SQLite.Entity.SQLiteEntityProviderServices, Dev

Posted: Thu 05 Dec 2013 19:42
by gteijido
Hi,

I´m getting an error trying to connect to a SQLite Db.

These are the steps I followed:
. I´ve created a console app (VS 2012, C# 4.5).
. I´ve added the Entity Framework 6.0.0.0 using NuGet.
. I´ve downlaoded the dotConnector free trial and installed it.
. I´ve added the following references by browsing the files:
1. Devart.Data
2. Devart.Data.SQLite
3. Devart.Data.SQLite.Entity (from the Entity\EF6 folder)
. I´ve this app.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="Devart.Data.SQLite" type="Devart.Data.SQLite.Entity.SQLiteEntityProviderServices, Devart.Data.SQLite.Entity, Version=5.1.26.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</providers>
</entityFramework>
<connectionStrings>
<add name="PluginDbContext" connectionString="Data Source=c:\mydb.db;Version=3;" providerName="Devart.Data.SQLite" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
. I´ve added the call to the dbinitializer in the main method of the Program class.
. When I run this, at the dbInitializer.InitializeDatabase(new PluginDbContext()); call, I get the following error:

The 'Instance' member of the Entity Framework provider type 'Devart.Data.SQLite.Entity.SQLiteEntityProviderServices, Devart.Data.SQLite.Entity, Version=5.1.45.0, Culture=neutral, PublicKeyToken=09af7300eec23701' did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Any ideas about what could be causing this?

Thanks!

Re: The 'Instance' member of the Entity Framework provider type 'Devart.Data.SQLite.Entity.SQLiteEntityProviderServices, Dev

Posted: Fri 06 Dec 2013 11:14
by Shalex
Please replace

Code: Select all

Devart.Data.SQLite.Entity, Version=5.1.26.0
with

Code: Select all

Devart.Data.SQLite.Entity, Version=5.1.26.6
in your app.config file.