9
votes

I'm trying to connect to Oracle DB via EW. On method OnConfiguring is error:

System.TypeLoadException: 'Method 'get_Info' in type 'Oracle.EntityFrameworkCore.Infrastructure.Internal.OracleOptionsExtension' from assembly 'Oracle.EntityFrameworkCore, Version=2.0.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342' does not have an implementation.'

public class Template
{

    public int Id { get; set; }

    public string Info { get; set; }

}


class TemlateContext : DbContext

{
    public DbSet<Template> Templates { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {

        optionsBuilder.UseOracle(@"User Id = user; Password = pass; Data Source =source;

//here error


    }

}
2
Are you using EF Core 3? Because Oracle doesn't support it yet. - kfinity
Please post the contents of your dotnetcore csproj file, to list the targetframework(s) and packagerefererencs. - granadaCoder
EF Core 3 is now supported since version 3.19.0-beta1 of the Oracle.EntityFrameworkCore nuget package - Sue Maurizio

2 Answers

1
votes

I noticed this started happening to me today, some time after I'd already updated to .NET Core 3 for my project and had no issues. Turns out the default scaffolding used when adding an empty mvc controller via solution explorer will add references to EF Core 3 within your web project. I do not use EF Core in our production web projects. For me it was a conflict with the test project we use which uses a different version of EF Core for some database mocking.

Anyway, for the time being I will just not add controllers via the studio options so that does not happen.

-4
votes

I switch to .net core 2.2 and and everything works