I created a lib folder in my projects folder and then with 'Add Reference' added the reference to my project. It works well for me.
But when I executed this DLL in another system it throws an Exception "Cannot load the file or..........."
Exception file attached.
Solved! Go to Solution.
yes the error message says that the same, specified file could not be found. But I have added the reference for the same and it works well on my system.
My query is how can I get the file included for other machines, so that the dll executes without exception. Is there any other way? The dll also could not be registered in any system.
Any dependent assemblies used by your assembly, directly or indirectly, must be in the same folder as your plugin's main assembly, or must be in the same folder where acad.exe is located.
You don't mention how you 'executed' the DLL, but you should test it using NETLOAD, in addition to any other means of loading, such as AutoCAD's Auto-loader, and by registering the assembly for demand-loading in the registry.
I added the external third party dll in the projects folder.
The DLL I created was loaded with NETLOAD. When it goes to command which uses the functions from the external, throws exception.
Note in the error message it says 'Could not load file or assembly DocumentFormat.OpenXml' (bloh blah blah) or one of its dependencies
In other words, you must look at that assembly (DocumentFormat.OpenXml) and see what additional assemblies it is dependent on (e.g, what assemblies does it reference, other than the standard framework assemblies), and you must also include those dependent assemblies in your project output folder, if they are not already there.
One common cause of this problem is a dependent assembly that's installed into the Global Assembly Cache, which will not be copied to the project folder. In that case you need to ensure that any such assemblies are installed on the target system as well.
Start with some of our most frequented solutions to get help installing your software.