WPF dockbar rhinocommon error

Hello, I got trouble when I load my plugin.

I developed plugin with wpf and reactiveui and visual studio 2017.

  • condition: solution Configuration is Debug
    When I set solution Configurations to Debug and start rhino6 using visual studio, Install my plugin is Ok.

But, when I open rhino.exe and install my plugin, rhino 6 suddenly closed.

  • condition: solution Configuration is Release
    When I set solution Configurations to Release and start rhino6 using visual studio, Loading plugin return error and message is below image.
    But, when I start visual studio again, plugin is already installed.

When I open rhino.exe and install my plugin, rhino 6 suddenly closed samely Debug condition

In my guess, when I create DockBar, rhino is closed.

var createOptions = new DockBarCreateOptions
                DockLocation = DockBarDockLocation.Left,
                Visible = true,
                DockStyle = DockBarDockStyle.LeftAndRight,
                FloatPoint = new System.Drawing.Point(0, 0)
            this.MyDockBar = new MainViewDockBar();

public class MainViewDockBar : DockBar
        private readonly MainView mainView;

        public MainViewDockBar()
            : base(MyRhinoCAMPlugIn.Instance, BarId, "WPF")
            this.mainView = new MainView();
            this.SetContentControl(new WpfHost(this.mainView, null));

        public static Guid BarId => new Guid("{c520731e-376a-4d82-975a-403664fca2fc}");

this is my creating dockbar code.

I don’t know why my plugin can’t load.

If I change CreateDockBar to Rhino_DotNet version, No error happen

this.MainView = new MainView();
            ElementHost host = new ElementHost
                Dock = System.Windows.Forms.DockStyle.Fill,
                Child = this.MainView
            MRhinoUiDockBar dockBar = new MRhinoUiDockBar(Guid.NewGuid(), "myDockBar", host);

                new System.Drawing.Point(200, 200));

My rhino version is recent version 6.13.


I would recommend using the panel system (Rhino.UI.Panels.Register) which will allow you to directly use a WPF user control as a panel and properly integrate with other panels. Not sure what is going on without a project to look at. If you send me a solution I would be happy to take a look.

Hello @JohnM

Sorry for late reply.

I made sample project and that code is also raise crush because of RhinoCommon Dockbar.

I tried to use rhino panel, but when I open some 3dm file, my panel is changed to only gray background.
But if I move to other panel and return, my view is loaded.

But that situation is not happen in https://github.com/Skm1221/RhinoWPFPlugin .
Maybe my real project is bigger than sample project. So, for rerendering panel, more cost is needed.

It is hard to send solution to you because it is my company project solution.

  • Kyungmin