Problem trying to add UIPlugin

Hello, I’m a total newbie in programming in c#, I have some experience in java and I did a basic course on c# on MVA.
I’m starting to play with rhinocommons, i’ve already seen how to create a command plugin (and it went all ok) and now I’m searching some more tutorial to go on with my experience.
My goal is to realize a customized version of rhino for a project inside my recently founded startup.
Now I’m following this tutorial to create a winform UI inside my project.
The build goes ok, but when I load the plugin in rhino it crash at the line in which I use the “MRhinoDockBarManager.CreateRhinoDockBar…”

This is my code in the plugin.cs

thank you


p.s. this is a screenshot of the error that I get from VS

The article you reference is somewhat old and targets Rhino 4.0, not Rhino 5. If you want to make a dockable bar in Rhino 5, see the following examples:

Thank you very much dale! It seems to work fine now!
One more question: is there a way to do add toolbars via rhinosdk, instead the dockable bar?

Toolbars are not created with RhinoCommon, but just with Rhino itself using the Toolbar command. Check the Rhino help file for details.

If you give the RUI file the exact same name as the plug-in RHP file and install it in the folder containing the RHP file (or its parent folder) Rhino will automatically stage it in a writable location and open it at startup.