Author Topic: System.IO.FileNotFoundException and AutoCAD support file search path  (Read 1579 times)

0 Members and 1 Guest are viewing this topic.

neyton

  • Newt
  • Posts: 68
I'm creating a program that has a "rehost workflowdesigner" (like SubAssembly Composer did) and it fails to create the toolbox controls.

The error that occurs:
System.IO.FileNotFoundException: Could not load file or assembly....

So far I understand that, because the DLL is not in the GAC, windows cannot find it.

So I tested the following hypotheses:

1) NETLOAD for the first time, without setting DLL folder in "support file search path"
when calling the command, result: ERROR

2) Add the DLL folder to the "support file search path" and then NETLOAD
when calling the command, result: WORKS

3) Enable autoload by the "LOADCTRLS" key (defined in IExtensionApplication.Initialize), without adding the DLL in the "support file search path"
when calling the command, result: ERROR

4) Now that the dll is loaded by the registry ("LOADCTRLS" ), still without the "support file search path", when calling the command
when calling the command, result: ERROR

5) In the same cad session as in step 4, add the DLL to the ""support file search path", editing the field without clicking the "Browse" button
when calling the command, result: ERROR

6) In the same cad session as in step 5, add the DLL to the ""support file search path", editing the field by clicking the "Browse" button
when calling the command, result: ERROR

7) In the same cad session as in step 6, I call the NETLOAD command (filedia=1), navigate to the DLL folder, DO NOT SELECT ANYTHING AND CLICK CANCEL
when calling the command, result: WORKS

8) I close cad, open it again, set FILEDIA=0
when calling the command, result: ERROR

9) In the same cad session of step 8, NETLOAD, I inform the full path of the DLL
when calling the command, result: ERROR

10) In the same cad session as in step 9, FILEDIA=1, NETLOAD, I navigate to the folder, but I don't select anything, as in step 7,
when calling the command, result: WORKS

So it concludes that the NETLOAD command doesn't just do an "Assembly.LoadFrom".

And the fact that it works with FILEDIA=1, makes me believe that it is the part of the code that shows the NETLOAD window that somehow makes the DLL, or its types
visible and the System.IO.FileNotFoundException error does not occur

I added the code so you can look.
If you can help me, thank you
Visit my website: http://tbn2.blogspot.com