Migrate Grasshopper plugin to Rhino 8 encounter errors

I was trying to test my GH plugin for Rhino 8 and just switched the debug program from Rhino7 to Rhino8.
Then suddenly I got this:
image

Based on some basic search, it seems Rhino 8 has moved to NET Core for the multi-platform compatibility purposes.

Is there any guidance how this will affect the current GH plugins and how we should adapt to it?

Any McNeel staff here?

I am, but I don’t know the answer. I’ll make sure someone who does is aware of this question.

Hi @xliotx,

To start Visual Studio debugging in .NET Core, you need to either multi target your plugin so it compiles for both net48 and net7.0, or create a separate .NET 7 launcher project as outlined in our Moving to .NET 7 guide.

Hope this helps!
Curtis.

Hi @curtisw , thank you for the quick reply.
To support both Rhino 7 and Rhino 8, I guess a multi-target solution is the way to go?
I guess if I abandon net48, then my plugin won’t be available to Rhino 7, correct?

Yes you still need to target net48 for Rhino 7, and also for Rhino 8 when it is running in .NET Framework, which some users might need for things like Rhino.Inside Revit or other for plugins that are not yet compatible with .NET Core.

You don’t have to target net7.0 to support Rhino 8 as it can still load net48 assemblies, however going forward you would likely want to multi target your plugin.

Wait, if Rhino 8 loads net48 assemblies, then can I debug in Rhino 8 with net48?

Hey @xliotx,

Yes, Rhino 8 can run in either .NET Framework or .NET Core runtimes, you can tell it which runtime to use by passing either /netfx or /netcore as arguments. You can see a sample launchSettings.json file here how you might be able to debug Rhino 8 in either runtime, and Rhino 7 using the same project. launchSettings is configured using VS’s launch profiles dialog.