I've encountered this exception when trying to call
Looks like this is not very common on the net (or Google has some trouble searching it?). The only possible cause I could find is due to
in-memory database or some kind of provider that is not
But when debugging, I can see that the provider name is
Oracle.EntityFrameworkCore, I'm using
Oracle.EntityFrameworkCore 2.19.30 (to connect to an Oracle Database). So this is confusing now, I'm not sure what's wrong here.
The code is simple like this:
I think the exception thrown is very confusing. I had to look into the source code for
RelationalDatabaseFacadeExtensions.GetRelationalService via which I can see somehow the
TService is not loaded. That service type may be contained in some dll (the most possible one is
Microsoft.EntityFrameworkCore.Relational.dll, if that dll is not loaded correctly, it will throw the described exception.
Actually in my case, that dll is loaded with wrong version (22.214.171.124 is loaded whereas the
Microsoft.EntityFrameworkCore version is 126.96.36.199). All this happened while I try to load them dynamically (not tightly referencing them in projects).