0

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=3.1.9.0, 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

[Update]

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

Kirsten
  • 15,730
  • 41
  • 179
  • 318

1 Answers1

0

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.

Kirsten
  • 15,730
  • 41
  • 179
  • 318
  • Here is the follow up question: https://stackoverflow.com/questions/66270632/nu1701-can-i-reference-a-winforms-framework-library-from-a-standard-2-0-library – Kirsten Feb 19 '21 at 01:47