Unable to load plugin due to exception in Plugin.GetLicense

In the latest version of Rhino 7 on Windows, I’m unable to install my plugin which has been working since Rhino 6. I’m not sure when it stopped working, because I always had a valid license for the plugin so it never went into license validation. However if I try to do a fresh install, it fails. It still works in Rhino 7 if I register the plugin via Rhino 6.

The problem occurs in my Plugin OnLoad which looks like:

        protected override LoadReturnCode OnLoad(ref string errorMessage) {
            // note: there's currently a bug in Rhino 6 where a null mask does not show the text box entry, so we supply a mask.
            var mask = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
            var rc = GetLicense(LicenseCapabilities.CanBeSpecified, null, ValidateProductKey, LeaseChanged);
            if (!rc)
                return LoadReturnCode.ErrorShowDialog;
            
            return base.OnLoad(ref errorMessage);
        }

When I drag the plugin into Rhino, first I see an IndexOutOfRange exception before the validation dialog appears:

Then I see the validation dialog:
image

If I click “Enter your license key”, I see a null reference exception within the Rhino code ValidationClient.dll!ValidationClient.UI.Views.EnterLicenseKeyView.EnterLicenseKeyView(ValidationClient.UI.ViewModels.EnterLicenseKey step)

and then Rhino says plugin loading failed.

I just tried updating to the latest RhinoCommon and the problem continues.

I attached the sample plugin.

TestPlugin.zip (26.5 KB)

Hi @Max_Eskin there was a crash bug related to 7.17’s licensing that has been corrected in 7.18. Can you see if your plugin licenses correctly in that version?

Yes, looks like that fixes it, thanks.

1 Like