Best Location to put Plugins licensing Code

I am trying to add some licensing code to my plugins, so that users have to ask me for license key.

I would like to know where should I put those code?

Currently, I have put the code in

  protected override LoadReturnCode OnLoad(ref string errorMessage)
  {
        
        return LoadReturnCode.ErrorShowDialog;
  }

But then after the code failed, I had to restart rhino in order for the plugins to run again. So I wonder where is the best place to put licensing code.

Hi @TobyLai,

You might have your commands check for a valid license, rather than the plug-in startup code.

ā€“ Dale