-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit Tests Fail With Could not load file or assembly errors when using Entity Framework Core 2.0 #266
Comments
@bigswede74: Could you help us with a project repro please? |
Hello AbhitejJohn, |
Thanks Brad. Will get back on this. |
Hello @AbhitejJohn |
@bigswede74: Looks like a .Net issue reported at dotnet/standard#476 and dotnet/efcore#9046. The workaround with bindingredirects worked for me on the repro you shared. |
@AbhitejJohn the problem with this fix is when you add the app.config file to a test project the tests disappear from the text explorer and are no longer discoverable. |
@bigswede74: That's odd. That issue seems to be talking about a stale config file. This config file Appconfig.zip works for me. Can you give it a shot please? |
@AbhitejJohn the assembly redirect worked. |
Description
After upgrading my projects to use Entity Framework Core 2.0 most of my unit tests are failing with various assembly errors. Some of the unit tests use the Entity Framework Core InMemory provider to mock database data.
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Steps to reproduce
System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Expected behavior
UnitTests should pass
Actual behavior
Unit tests fail with below error
System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
Environment
Visual Studio 2017 15.3.3
Project Console Application targeting .net 4.7 framework
Test Project with NuGetPackages
The text was updated successfully, but these errors were encountered: