# Migrating plugin's license system to RH6

**URL:** <https://discourse.mcneel.com/t/migrating-plugins-license-system-to-rh6/86977>\
**Category:** Rhino Developer\
**Tags:** rhinocommon, rhino6, licensevalidation\
**Created:** [August 2, 2019, 9:12am UTC](https://discourse.mcneel.com/t/migrating-plugins-license-system-to-rh6/86977 "2019-08-02T09:12:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthieu\_from\_NAVINN](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matthieu_from_navinn/32/163124_2.png) [@Matthieu\_from\_NAVINN](https://discourse.mcneel.com/u/Matthieu_from_NAVINN)\
**Post date:** [August 2, 2019, 9:12am UTC](https://discourse.mcneel.com/t/migrating-plugins-license-system-to-rh6/86977/1 "2019-08-02T09:12:40Z")

</div>

Hi,  
I’m migrating a plugin to RH6 and I can’t figure how to adapt my RH5 license system.

In rhino5 I was doing this, which worked nicely:

```
Dim validator As New Rhino.PlugIns.ValidateProductKeyDelegate(AddressOf ValidateProductKey)
Dim rc As Boolean = GetLicense(Rhino.PlugIns.LicenseBuildType.Release, validator)

```

But I dont get how to do the exact same thing with Rhino6 (I don’t need CloudZoo). I understood that I had to create a `OnLeaseChangedDelegate` but when rhino starts it only display an empty license windows, with no field for serial number.  
Here is my code:

```
' Ask Rhino to get a product license.
      Dim validator As New Rhino.PlugIns.ValidateProductKeyDelegate(AddressOf ValidateProductKey)
      Dim LeaseChanged As New Rhino.PlugIns.OnLeaseChangedDelegate(AddressOf OnLeaseChanged)
      Dim rc As Boolean = GetLicense(Rhino.PlugIns.LicenseBuildType.Release, validator, LeaseChanged)
      If Not rc Then
           Return Rhino.PlugIns.LoadReturnCode.ErrorNoDialog
      End If

      Private Sub OnLeaseChanged(ByVal args As LicenseLeaseChangedEventArgs, <Out> ByRef icon As System.Drawing.Icon)
            icon = My.Resources.BeamCalc

            'If args.Lease Is Nothing Then
            'End If
      End Sub

```

And this is what I get when starting rhino (It pops up several times if I try to close it):  
 ![LicenseIssue](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/c/0/c0b77d4ccedee7550a2d11297406cf77f67056b9.jpeg)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [August 2, 2019, 7:14pm UTC](https://discourse.mcneel.com/t/migrating-plugins-license-system-to-rh6/86977/2 "2019-08-02T19:14:09Z")

</div>

Hi @Matthieu_from_NAVINN,

Does this SDK sample provide any help?

> **[mcneel/rhino-developer-samples](https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsWithLicense)**
>
> Rhino and Grasshopper developer sample code. Contribute to mcneel/rhino-developer-samples development by creating an account on GitHub.

– Dale

---

<div class="post-metadata">

**Author:** ![Matthieu\_from\_NAVINN](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/matthieu_from_navinn/32/163124_2.png) [@Matthieu\_from\_NAVINN](https://discourse.mcneel.com/u/Matthieu_from_NAVINN)\
**Post date:** [August 5, 2019, 1:06pm UTC](https://discourse.mcneel.com/t/migrating-plugins-license-system-to-rh6/86977/3 "2019-08-05T13:06:34Z")

</div>

Yes it does! I was using the version without `LicenseCapabilities` while it seems it was required. Thanks for your help @dale
