System.TypeLoadException when configuring DbContext
See original GitHub issueException details
System.TypeLoadException
HResult=0x80131522
Message=Method 'PopulateDebugInfo' in type 'Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal.NpgsqlOptionsExtension' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=3.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' does not have an implementation.
Source=Npgsql.EntityFrameworkCore.PostgreSQL
StackTrace:
at Microsoft.EntityFrameworkCore.NpgsqlDbContextOptionsExtensions.UseNpgsql(DbContextOptionsBuilder optionsBuilder, String connectionString, Action`1 npgsqlOptionsAction)
at ...OnConfiguring(DbContextOptionsBuilder optionsBuilder)
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
at Microsoft.EntityFrameworkCore.DbContext.Set[TEntity]()
(further StackTrace is omitted)
Environment
Microsoft.EntityFrameworkCore 3.0.0-preview.19074.3
Npgsql.EntityFrameworkCore.PostgreSQL 3.0.0-ci.1451
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (12 by maintainers)
Top Results From Across the Web
c# - TypeLoadException with DbContext
This type of error usually indicates that different assemblies are somehow referencing different versions of EntityFramework.dll.
Read more >Scaffold-DbContext - System.TypeLoadException: Method ...
I am trying to install entity framework 3.1.0 to .netstandard 2.0. ... System.TypeLoadException: Method 'Create' in type 'Microsoft.
Read more >System.TypeLoadException - elmah.io
TypeLoadException happens when a type could not be loaded by the CLR. This can be caused by several different issues, but here's a...
Read more >"Entity Framework Core" -> "Add Migration" does not work
System.TypeLoadException: Could not load type 'Microsoft.EntityFrameworkCore.Internal.SemanticVersionComparer' from assembly 'Microsoft.
Read more >Abp.EntityFramework does not work with Core 2.x #7550
Error occurs in Startup.cs at "//Configure Log4Net logging" on "AddFacility" method. System.TypeLoadException HResult=0x80131522 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@CumpsD There is a prelease package that solved that issue for me.
After the upgrade I couldn’t connect to my old database. Turns out the PostgreSQL option “standard_conforming_strings” has to be “on” or Npgsql refuses to connect. Since PostgreSQL 9.1 “on” is the default value but apparently in our internal database this was manually turned off.
The following statement solves the issue: