Could not load file or assembly 'Microsoft.EntityFrameworkCore, when calling Standard Library DLL


I have the following stack with an XAF Winforms, Entity Framework Project;

Framework 4.72 exe which references
Framework 4.7.2 library1 which references
.Net Standard 2.0 library2 which references
.Net Standard 2.0 library3

A call down the stack to a method in library3 produces an exception.

  Message=Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.

I was able to replicate the problem in a Framework 4.7.2 unit test that called Library2 directly and to solve that.

To solve the problem in the unit test I used BindingRedirectGenerator to generate the runtime section of the unit test app.config as per the answer to my question here

However this does not work when I use the generated section for the application app.config


I think the issue is that Library3 calls a framework library... investigating.

asked on Stack Overflow Feb 16, 2021 by Kirsten Greed • edited Feb 19, 2021 by Kirsten Greed

1 Answer


This is a form of the question I asked here Yet even after having asked the question before I still got caught. The solution was to create a unit test project with a dialog box, then, at the message box, run BindingRedirectGenerator to make the app.config

I am up for advice on whether this question is useful (since the problem was encountered a different way) or should be closed.

The issue in not getting the technique working for the .exe appears to be a new problem to do with calling a framework library from a standard library.

answered on Stack Overflow Feb 18, 2021 by Kirsten Greed • edited Feb 19, 2021 by Kirsten Greed

User contributions licensed under CC BY-SA 3.0