.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Referenced third party DLL throws Exception on other Machines .

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
newautocad123
701 Views, 6 Replies

Referenced third party DLL throws Exception on other Machines .

Hi,

 

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.

6 REPLIES 6
Message 2 of 7

It is look like AutoCAD can not find DocumentFormat.OpenXml.dll

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 7

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.

 

Thanks.

Message 4 of 7

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. 

 

Message 5 of 7

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.

 

Message 6 of 7

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.

Message 7 of 7

Installed the  assemblies to the target system also. It works well.

 

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost