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.Metadata.IRelationalEntityTypeAnnotations' not found using .net core 3.0 preview

See original GitHub issue

Describe the bug Exception thrown by Audit.Net library when saving changes using latest .net core 3.0 preview (3.0.100-preview6-012264).

To Reproduce Add Audit.Net to library target netcoreapp3.0. I tried with both approaches of deriving from AuditDbContext and without inheritance.

Libraries (specify the Audit.NET extensions being used including version): For example:

  • Audit.EntityFramework 14.5.7

Additional context Stacktrace:

Unhandled Exception: System.TypeLoadException: Could not load type ‘Microsoft.EntityFrameworkCore.Metadata.IRelationalEntityTypeAnnotations’ from assembly ‘Microsoft.EntityFrameworkCore.Relational, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60’. at Audit.EntityFramework.DbContextHelper.GetEntityName(DbContext dbContext, EntityEntry entry) at Audit.EntityFramework.DbContextHelper.CreateAuditEvent(IAuditDbContext context) at Audit.EntityFramework.DbContextHelper.SaveChangesAsync(IAuditDbContext context, Func`1 baseSaveChanges) at Audit.EntityFramework.AuditDbContext.SaveChangesAsync(CancellationToken cancellationToken)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bankiancommented, Jul 26, 2019

Now working. I hadn’t spotted the new version that arrived yesterday. Thank you!
Ian

0reactions
trikk86commented, Jul 21, 2020

Hi I have the same issue: Audit,EntityFramework,Core 15,2.3 Why does it reference EF 2.2.4.0?

or am I missing something?

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Could not load type 'Microsoft.EntityFrameworkCore. ...
I am trying to connect my mvc core application to an existing ms access database roughly following this guide, but I am getting...
Read more >
Could not load type 'Microsoft.EntityFrameworkCore. ...
Could not load type 'Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtensionWithDebugInfo' from assembly 'Microsoft.
Read more >
Could not load file or assembly class library " ...
First, I am creating for the first time a C# class library in .Net 6 that is a data access layer for other...
Read more >
Microsoft.EntityFrameworkCore.Relational 7.0.10
Version Downloads Last updated 8.0.0‑preview.7.23375.4 6,062 12 days ago 8.0.0‑preview.6.23329.4 29,791 a month ago 8.0.0‑preview.5.23280.1 38,000 2 months ago
Read more >
Fix For Entity Framework Tools Error
TypeLoadException: Could not load type 'Microsoft. ... code was using .NET 5.0.1 and the version of entity framework core tools was 3.1.4.
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