Page 1 of 1

Error on SQLite context instance creation

Posted: Tue 06 Jan 2015 15:00
by Thiago Diniz
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);                
}

Re: Error on SQLite context instance creation

Posted: Tue 06 Jan 2015 16:33
by Shalex
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).

Re: Error on SQLite context instance creation

Posted: Tue 06 Jan 2015 18:43
by Thiago Diniz
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,