Ticket Change Details
Not logged in

Artifact ID: e764d49fdba46dfa14887758db04905cf0e5201c
Ticket: ad28d8e026c4c2275547a58bac3fe426ead63faa
System.Data.Entity.Core.ProviderIncompatibleException on netcore3 (using EF 6.3)
User & Date: anonymous 2019-10-30 18:28:39

  1. icomment:
    Hello, OT here again (the one with the attachment at 2019-10-30 12:42:14 was a different person),
    I wanted to note that years ago I got rid of all magic tokens inside app.config or .edmx files (meanwhile migrated to code first) by doing two things:
    1) The class inheriting from DbContext only uses the ctor which passes in a read DbConnection instance. In my case this can be SQLServer or SQLite, determined at runtime by user settings.
    2) There is one configuration class inside the same assembly inheriting from System.Data.Entity.DbConfiguration and doing the following inside the ctor:
    	this.SetProviderFactory("System.Data.SQLite", System.Data.SQLite.SQLiteFactory.Instance);
    	var providerServices = GetService<System.Data.Entity.Core.Common.DbProviderServices>(System.Data.SQLite.EF6.SQLiteProviderFactory.Instance);
    	Debug.Assert(providerServices != null, "providerServices != null");
    			this.SetProviderServices("System.Data.SQLite", providerServices);
    Why and how this works I figured out using Reflection years ago. Might be outdated.
  2. login: "anonymous"
  3. mimetype: "text/x-fossil-plain"