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.

CreateDbSetMock throws TypeLoadException

See original GitHub issue

Hallo,

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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
huysentruitwcommented, Oct 1, 2019

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.

1reaction
huysentruitwcommented, Dec 15, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

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