I want to use a windows form that is in a Framework 4.7.2 library
I have the following stack ;
Framework 4.72 XAF Winforms exe which references
Framework 4.7.2 library1 which references
Framework 4.7.2 library2 which references a a standard2.0 library
I have the following code in Library2
public static void ShowMessageBox()
{
MessageBox.Show("hi");
}
public static void ShowForm() // errors when this is called
{
var form = new Form1(); // debugger can not reach here
MessageBox.Show("hi2");
}
I can call ShowMessageBox However if I call ShowForm I get a System.IO.FileNotFoundException exception occurs immediately. The line that instantiates the form is never reached.
System.IO.FileNotFoundException: 'Could not load file or assembly 'MyLibrary,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=a3471ea16b9add4c'
or one of its dependencies. The system cannot find the file specified.'