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
}
}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With