Error loading PlugIn using PlugIn-Installer

Hi!
I’m having a strange problem installing our Rhino6-plugin under development:

The plugin runs in Rhino 6 - if I open PluginManager and then do a manual install of the rhp-file in the output-directory of VS19 where I have also some other DLLs which are required by the PlugIn.

If I put the content in a rhi-file as described by the docs the Rhino installer engine installs the plugin. I can see the registry entries as well as the installed files. Everything seems fine.
But after startup Rhino 6 tells me “Error loading - MyPlugin” with no further details.
(First I ran into this issue after performing a manual registration of the plugin via an MSI)

I know that this is not enough information to help me, but are there any methods to further investigate in this issue? I’m somehow stuck in the mud.

Kind regards
Juergen

Hi @Juergen,

Are these DLL’s .NET? If so, do they need to be unblocked? @will, doesn’t the Rhino installer do this?

– Dale

@dale,
I have one .NET-DLL containing some translations and a DLL built with LLVM/Clang, responsible for the FEM-analysis. The second one is called via a external C-function only if the user calls a command - thus, not a “strict” dependency.

Both DLLs are unblocked - I am experiencing this problem on the developer-machine (I’ll crosscheck on another machine).

Juergen

Hmm, this could either be a problem with the plug-in loader or with how the Rhino Installer Engine is registering the plug-in (or something else entirely!). Could you send us the registry entries to take a look at? You mention an initial failed attempt using an MSI – did you completely wipe the relevant parts of the registry before trying again with an RHI? I’d be interested to know whether the RHI works on another machine.

Will,
yes - I wiped all entries in the Registry related to the PlugIn-GUID as well as the files.

In the meanwhile I had the opportunity to install it on a Win7 machine and on a fresh Win10 Virtual Machine with an evaluation copy of Rhino 6 - and it worked!
Seems that I have this issue on my Developer-Machine only.

Juergen

OK, that’s good news at least! I appreciate your efforts to investigate and isolate the issue to your development machine only.

@brian, @stevebaer – do either of you have any ideas here?

You could run TestDotNetMessages command and restart Rhino to get extra information printed to the command line while loading of the plug-in. This may give some details on what is going wrong.

1 Like

This isn’t a problem of registration - if it were, Rhino wouldn’t even get to the point of showing an error loading the plug-in.

Since you are able to reproduce this problem by using an MSI installer, too, my guess is that this problem is related to your plug-in not behaving properly when being installed in a strange new location.

  1. Are you sure you’ve copied all the dependent DLLs into the installer?
  2. Have you tried drag/drop loading the plug-in? My guess is that you’ll get the same error when dragging from the install location that the RHI selected.
  3. What code do you have in OnLoadPlugin? What are the chances that an exception is being thrown during plug-in load that causes failures? Does your plug-in load properly when all the OnLoadPlugin code is removed?

Yes, all DLLs are there. If I drag/drop install the PlugIn from the installed location, I get the same error with no .NET-debug messages (TestDotNetMessages is on).

If I do the same from the rhi/zip-source-location it works! I’m really confused now:

`Loading Rhino Render, version 1.50, Aug 23 2019, 15:23:19`
`- plug-in passes RhinoCommon.DLL reference version check`
`- loading assembly using Reflection::Assembly::LoadFrom`
`- extracting plug-in attributes to detemine vendor information`
`- creating plug-in and command classes`
`[PlugIn::Create] Start`
`  plugin_name = Concha`
`  Looking for plug-in's GuidAttribute`
`Starting up TAILSIT Concha PlugIn`
`Starting Concha v2.0.0.17984`
`  Created PlugIn Instance`
`[PlugIn::Create] Finished`
`RhinoCommon successfully loaded [sourcepath]\Concha\Rhino 6\Concha.rhp` `Initialize Concha`

For debugging purposes, the first command is a Rhino-message if the constructor or the OnLoad-method are called. They didn’t show up.

The strange thing now is, that after the drag/drop-installation from the source path, the installation via RHI also works. I don’t know how, but it seems the issue is resolved.

Thanks for your help - Juergen

You’re probably just getting lucky - I recommend creating a virtual machine with a clean image of Windows, then with a clean install of Rhino to test with. We do this all the time to make sure that residual information from previous installations do not mask problems. It’s possible that some registry keys or files are sitting around somewhere that makes this work.

2 Likes