CreateDbSetMock throws TypeLoadException
See original GitHub issueHallo,
We have currently updated our project to .netcore 3 and Entityframework to v 3. And now we are getting an exception when trying to create db set mock .
Exception : System.TypeLoadException : Method ‘ExecuteAsync’ in type ‘EntityFrameworkCoreMock.DbAsyncQueryProvider`1’ from assembly ‘EntityFrameworkCoreMock.Shared, Version=1.0.0.26, Culture=neutral, PublicKeyToken=null’ does not have an implementation.
Code : var dbMock = new DbContextMock<DbContext>(); dbMock.CreateDbSetMock<Email>(m => m.EmailId, _emailIds);
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
CreateDbSetMock throws TypeLoadException · Issue #21
And now we are getting an exception when trying to create db set mock . Exception : System.TypeLoadException : Method 'ExecuteAsync' in type ......
Read more >What could be causing a System.TypeLoadException in ...
I've got a C# .NET class library MyClassLibrary that compiles fine. I'm trying to create a unit test project for it (using Visual...
Read more >How do I solve the TypeLoadException Error in unit testing
I am getting an error when trying to run a unit test. It says System.TypeLoadException: Could not load type 'Parsers.FileOps' from assembly ' ......
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 FreeTop 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
Top GitHub Comments
I’ve tried to support multiple EF versions in one project in the past, but that didn’t work out. That’s the reason I have an almost identical library for EF6. I think EF Core 3 will cause the same issue as we can’t target both. Let me check what should be done here.
I finally had the time to finish NuGet packages for EFCore 3 support. Please take a look at this project: https://github.com/huysentruitw/entity-framework-core3-mock
If there are any issues for the EF Core 3 version, please open them in there.
Regards!