How to reference other dlls into my plugin

How to reference other dlls into my plugin

Paulio
Advocate Advocate
2,311 Views
3 Replies
Message 1 of 4

How to reference other dlls into my plugin

Paulio
Advocate
Advocate

Ok this is my setup.

 

I have:

 

A plugin for Navisworks.

An executable which calls and runs the plugin.

A dll containing forms and methods that both the executable and the plugin need to access.

 

My question is: Where do I need to put this dll so that the plugin can find it? Currently, when I'm trying to debug my plugin, I'm getting a "could not load file or assembly {my dll}... The system cannot find the file specified" error as soon as it tries to access a method in the referenced dll.

 

I'm pretty new to Navisworks so any help would be very much appreciated.

 

Thanks

0 Likes
Accepted solutions (1)
2,312 Views
3 Replies
Replies (3)
Message 2 of 4

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

You need to copy any dependencies of the plugin except any generated by the Navisworks API into the 'dependencies' folder, instead of the same folder of the plugin dll 

 

 e.g. Assume the plugin is "NWPlugin", it has one dependent class: Class1.

 

<NW>\Plugins\NWPlugin\NWPlugin.dll

 

<NW>\Dependencies\Class1.dll

0 Likes
Message 3 of 4

Paulio
Advocate
Advocate

Excellent. Thank you very much.

0 Likes
Message 4 of 4

Wolfgang.B.Weh
Enthusiast
Enthusiast

I have a related question...

Say a plugin uses newer version of 3rd party DLLs which are also shipped with Navisworks (e.g. Syncfusion or NewtonSoft), and these newer DLLs get installed into the <NW>\Dependencies\ folder.

These newer DLLs usually have additional or changed methods or properties.

What seems to happen now is that the DLLs from the <NW> folder are used, not the DLLs from the <NW>\Dependencies\ folder.

As a result you get missing method exceptions.

 

 

How to resolve that?

 

Thanks

Wolfgang

0 Likes