in short:
I came across a strange behaviour using the build project (.rhp) from the windows site, on the mac side. looks like OnLoad is not called - and some validation is bypassed.
in detail:
the behaviour can be repeated by:
On the windows site: build a new Solution/Project based on the template for visual Studio 2022, use the sample command (add a line).
add code below to the Rhino.PlugIns.PlugIn class.
build the project with Configuration “Release”.
on the Windows site, the plugin is not loading - as expected.
On the mac site:
using the net7.0 .rhp Relase from the Windows site, create a .macrhi following this instruction and install the plugin on the mac site. The Plugin / command is running !
looks like OnLoad is never called
i know that this is not the recommended way to build a cross-platform plugin but it looks like it allows some strange behaviour or even licence bypassing.
@dan or @dale thanks for some thoughts / help / insights.
on the mac site with the .rhp build on the windows site ? (site or side ?)
i am afraid that this method might bypass a minimal licence validation i do for some customers.
above the minimal solution that shows the strange behaviour using the net7.0 release rhp:
(at least on my computer…)
on windows: - it does not load - as expected ! LoadReturnCode.ErrorShowDialog
on mac: no feedback in the command history, but LoadTestCommand is working (it should not as OnLoad will / should return LoadReturnCode.ErrorShowDialog
Command: LoadTestCommand
Fake Fail
failed loading LoadTestPlugin
LoadTestPluginAddingALine
The LoadTestCommand command will add a line right now.
The LoadTestCommand command added one line to the document.
is there a nicer pattern as workaround ?
can i derive from the command class ? class ValidatedCommand:Command
and put the Validation logic in there ?
… but not sure if there is a suitable override…
and then class MyTestCommandAddLine:ValidatedCommand