How to fix 'Method 'get_Info' in type 'Oracle.EntityFrameworkCore does not have an implementation.'

.net asp.net-core entity-framework-core oracle

Question

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


    }

}
1
5
10/9/2019 10:51:53 AM

Popular Answer

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.

0
10/9/2019 5:53:25 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow