Rhino crashes when CreateRhinoDockBar is called

I’m currently trying to run our plugin in Rhino 8 WIP. This works fine when I set the .NET runtime to be the .NET Framework, but just crashes the whole application when the runtime is NETCore.

I can reproduce this with a simple plugin (C#, .NET Framework 4.8) that creates a dock bar in OnLoad:

var mRhinoUiDockBar = new RMA.UI.MRhinoUiDockBar(
    Guid.NewGuid(), "DockBar", new Panel());
    this, mRhinoUiDockBar, false, 
    new System.Drawing.Point(0, 0));

Is the crash expected here? Could this be fixed or improved to throw a meaningful error that can be handled?

Then I have another question, is it possible to set SetDotNetRuntime from RhinoCommon?
I’m checking the current runtime via System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and try to set the runtime via RunScript in case it is the wrong one, but I guess I’m doing something wrong here:

Rhino.RhinoApp.RunScript(“_-SetDotNetRuntime Runtime=NETFramework”, true)

The command is not correctly executed, it just prints “Command: _-SetDotNetRuntime” in the command line but doesn’t change it.

Thank you in advance and best regards

is there anyone who can help me with this?
Are dock bars not supported when the runtime is netcore?
Best regards

The Rhino_dotnet project has been deprecated and no longer receives maintenance. I would suggest using the panel system provided by RhinoCommon. You can register a panel using Rhino.UI.Panels.Register. The Rhino_dotnet project will be removed from Rhino 9.

Another thing worth noting is that the new Panel system in v8 can provide DockBar like functionality where Panels can now dock top/bottom.

1 Like

Thanks a lot to both of you :slight_smile:
Switching to panels solved the issue.

1 Like