So, I might not be able to achieve anything at all here, but I figured I would ask. I followed some tutorials to building a *.dll file and then importing it into a project. I have it to where I have the “using testDLL” in the Forms, and the *.dll itself is imported as a a resource. I know that the forms project “sees” the definitions in the DLL because it autocompletes when I reference a class method, and File.Exists() returns true:
if (System.IO.File.Exists("C:\Projects\SimpleIntDLL\bin\Debug\net6.0\SimpleIntDLL.dll")
{
int i = new SimpleIntDLL.Class1().TestIntAgain();
Application.Run(new Form1());
}
However, when execution reaches the line that invokes a DLL method, the owning window (if one) throws a “FileNotFoundException” – here is the stack trace:
{“Could not load file or assembly ‘System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified.”:”System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”}
I don’t know what to do with this. I am pretty new to attempting DLLs but I’m confused as to how the Forms project can “see” the class definition but I can’t seem to invoke it.
Added reference to dll in forms project, browsed and selected the dll file manually. Ensured that the forms program saw the DLL with file.exists(). All runtime references to the dll fail.
6