question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load type 'Microsoft.EntityFrameworkCore.Query.Internal.ExpressionEqualityComparer' from assembly 'Microsoft.EntityFrameworkCore

See original GitHub issue

FirstOrDefault throws linq2db.EntityFrameworkCore.dll: 'Could not load type ‘Microsoft.EntityFrameworkCore.Query.Internal.ExpressionEqualityComparer’ from assembly 'Microsoft.EntityFrameworkCore, Version=5.0.0.0,

Do I miss something?

            LinqToDBForEFTools.Initialize();
            using (var efContext = new AccountingContextEf())
            {
                efContext.Database.OpenConnection();
                efContext.Database.Migrate();
                efContext.Database.CloseConnection();

                efContext.Database.EnsureCreated();
                var linq2DbContext = efContext.CreateLinqToDbContext();
                var first = linq2DbContext.GetTable<User>().FirstOrDefault();
            }

Environment details

linq2db version: 3.1.6 Database Server: SQLite In Memory .NET Framework: 5.0.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
HypeillingerChillingercommented, Nov 23, 2020

I will post a complete project this evening

0reactions
HypeillingerChillingercommented, Nov 23, 2020

Didn’t recognize that. Ok, that is the solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not load type 'Microsoft.EntityFrameworkCore.Query. ...
Though I am pretty late but after struggling with this error thought should post my bit too. In my case, a package MockQueryable....
Read more >
Could not load file or assembly class library " ...
When I run the application, I receive the error: Could not load file or assembly class library "Microsoft.EntityFrameworkCore version = 6.0 ...
Read more >
Could not load type 'Microsoft.EntityFrameworkCore. ...
Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtensionWithDebugInfo' from assembly 'Microsoft.
Read more >
Could not load type 'Microsoft.AspNetCore.Mvc. ...
As the error message said, in the Microsoft.AspNetCore.Mvc.ViewFeatures assembly, it doesn't have the Internal.ExpressionMetadataProvider class.
Read more >
Could not load type 'Microsoft.AspNetCore.Mvc.Internal. ...
I am upgrading my current project from .NET Core 3.1 to .NET 6.0. After upgrade of project along with its dependencies, I am...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found