Net7.0 plug-in doesn't work with ObjectPropertiesPage in Rhino 8

Hi,

Working through a funny problem…

  • Cloning the SampleCsEto example from here and compiling it works: I can load the plug-in fine in Rhino 8 and I get the new page in object properties. All seems fine.
  • If I create a new project in Visual Studio, targetting Net 7.0, and copy the same source files from the SampleCsEto project (using Nuget to grab the dependencies), it compiles fine but when I load it in Rhino, it seems to crash the entire Properties panel (i.e. the normal viewport page disappears, I get error messages in the console):
  • I discovered this when trying to write a new plug-in using Net7.0, spending a lot of time trying to pick apart my code to see if I was setting up the ObjectPropertiesPage, Panel, and PlugIn classes correctly :stuck_out_tongue: But it seems to be a difference between using Framework 4.8 and Net 7.0
  • To double-check, I created a new project targetting Framework 4.8, copied only the relevant code over (SampleCsEtoPlugin.cs and SampleCsEtoPropertiesPage.cs) and it runs totally fine:

Am I missing any tricks for getting it to work with Net 7.0 or is this a bug?

Best,

Tom

Hey @tom_svilans,

That is odd indeed, there should be no differences when you target .NET 7 vs. .NET 4.8 in this regard. Perhaps part of copying the code/resources caused a problem due to differing namespaces? In particular, using Properties\Resources.resx needs an additional nuget package and also some entries in your .csproj. Adding a new .resx instead of copying it helps get that set up properly.

At any rate, I’ve updated the SampleCsEto to multi-target .NET 7 and .NET 4.8 which hopefully helps you get started.

Cheers,
Curtis.

1 Like

Thanks, Curtis! I’ll give the updated example a shot.