Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type IDbContextOptionsExtensionWithDebugInfo from EntityFrameworkCore #17917

Closed
TomasHubelbauer opened this issue Sep 18, 2019 · 5 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@TomasHubelbauer
Copy link

I think I am able to reproduce closed #15192 in RC1.

dotnet --version: 3.0.100-rc1-014190

What I did:

  • Scaffold a new .NET Core MVC app with individual account auth:
    dotnet new mvc --auth Individual
  • Run the app using dotnet run and accept the self-signed certificate in the
    browser at https://localhost:5001
  • Register, sign out, sign in and sign out again to test the database
  • Remove app.db and ConnectionStrings in appSettings.json
  • Install the EF in-memory provider:
    dotnet add package Microsoft.EntityFrameworkCore.InMemory
  • Replace AddDbContext with
    services.AddDbContext<ApplicationDbContext>(options => options.UseInMemoryDatabase(nameof(aws_elastic_beanstalk)))
  • Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtensionWithDebugInfo' from assembly 'Microsoft.EntityFrameworkCore, Version=3.0.0.0

You can see the problem in this repo:

https://github.com/TomasHubelbauer/aws-elastic-beanstalk

Further technical details

EF Core version: 3.0.0-rc1.19457.4
Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) in memory
Target framework: (e.g. .NET Core 3.0) .NET Core 3.0.100-rc1-014190
Operating system: Windows 10
IDE: (e.g. Visual Studio 2019 16.3) CLI

@TomasHubelbauer TomasHubelbauer changed the title Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtensionWithDebugInfo' from assembly 'Microsoft.EntityFrameworkCore, Version=3.0.0.0' Could not load type IDbContextOptionsExtensionWithDebugInfo from EntityFrameworkCore Sep 18, 2019
@AndriySvyryd
Copy link
Member

@TomasHubelbauer You need to keep all dependencies at the same version, including Microsoft.EntityFrameworkCore.InMemory

@smitpatel smitpatel added closed-no-further-action The issue is closed and no further action is planned. and removed type-bug labels Sep 18, 2019
@TomasHubelbauer
Copy link
Author

Ah, I didn't realize dotnet add package will not install pre-release version. Wish the error message was better though.

@TomasHubelbauer
Copy link
Author

Another thing which doesn't help is that for my version of EF (3.0.0-rc1.19457.4) there is no corresponding version of the in-memory provider. The closes is 3.0.0-rc1.19456.14 .

@AndriySvyryd
Copy link
Member

I think you are referring to the ASP .NET Core version. Yes, unfortunately the build portion don't match EF for pre-release packages

@TomasHubelbauer
Copy link
Author

Indeed, I misread the package name. At least it's documented in this issue now for Google. FWIW I was able to get the above to work with in-memory once I switched that package to the RC1 version as well.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

4 participants