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.
System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=22.214.171.124, 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.
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.
User contributions licensed under CC BY-SA 3.0