I have developed a plugin for Grasshopper, and there is another plugin for Rhino as well. The issue arises when the Grasshopper plugin tries to load an assembly from the Rhino plugin, resulting in an exception. How can I manage this situation to ensure that the Grasshopper connector loads the assembly exclusively, without relying on the Rhino plugin? The exception message states: “Add value to collection of type ‘Microsoft.Xaml.Behaviors.BehaviorCollection’ threw an exception.”
if I delete above dll from rhino plugin bin folder then grasshopper connector works fine but its not workable solution
Ah, I see. My apologies for the confusion. It seems I provided incorrect information earlier. It is an window and Additionally, I am not using the comment syntax only so right now i share total code block
so is this creating issue for the exception i mention earlier
There isn’t anything in that Window that should throw any exceptions, it should work fine. Your Rhino Plugin however will need to have been created with the Checkbox to Use WPF in the Windows UI section of the template. Otherwise the plugin may not be including the necessary references to WindowsBase and PresentationCore which are required for WPF.
Do you have two projects right? one for Rhino and other for GH? It is one depending of the other? To me is not sure how are your dependenicies by your description.
If that works before Rhino/GH loads the plugins you can prevent the dll to be copied to bin by setting Local Copy to false on your dll.
You can also operate on files as Post-build events, for example this instruction copies the rhp in the parent folder as a dll so another project I have can reference it as a dependency, since both can not be in the same folder. In case this helps, just ask ChatGPT for the instructions you need.