Error on SQLite context instance creation

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for SQLite
Post Reply
Thiago Diniz
Posts: 2
Joined: Tue 06 Jan 2015 14:41

Error on SQLite context instance creation

Post by Thiago Diniz » Tue 06 Jan 2015 15:00

Hello,

I´m getting this error when i create an instance of the context to access my database.

The 'Instance' member of the Entity Framework provider type
'Devart.Data.SQLite.Entity.SQLiteEntityProviderServices,
Devart.Data.SQLite.Entity, Version=5.2.313.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.

Here is the code:

Code: Select all

AgilePdvDados ctx = new AgilePdvDados();
var produtos = ctx.PDVProduto;

foreach (var p in produtos)
{
    Console.WriteLine(p.Nome);                
}

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Error on SQLite context instance creation

Post by Shalex » Tue 06 Jan 2015 16:33

Please make sure that you updated the provider version to 5.2.313 in your app.config. Note that the revision number of provider in the entityFramework section is *.6 (5.2.313.6) but in DbProviderFactories - *.0 (5.2.313.0).

For more information, refer to http://blog.devart.com/entity-framework ... gistration.

If this doesn't help, send us your app.config (mark a confidential information with asterisks) and specify the current version (x.x.x) of your dotConnect for SQLite (you can check it via the Tools > SQLite > About menu of Visual Studio).

Thiago Diniz
Posts: 2
Joined: Tue 06 Jan 2015 14:41

Re: Error on SQLite context instance creation

Post by Thiago Diniz » Tue 06 Jan 2015 18:43

Hi,

The problem was in the app.config as you said.

"Note that the revision number of provider in the entityFramework section is *.6 (5.2.313.6) but in DbProviderFactories - *.0 (5.2.313.0)."

Thanks,

Post Reply