Toolbars Plugin throwing Exception on Startup in Rhino 8

I’ve noticed on all of our Rhino 8 users, there is an exception being thrown on startup. It appears to be coming from the Rhino Toolbars plugin, when it is loading:

[04/12/2024 10:42:24] [161] Loading Plugin: Toolbars
[04/12/2024 10:42:24] [162] System.MissingMethodException: No parameterless constructor defined for this object.
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Rhino.PlugIns.PlugIn.CreateCommandsHelper(PlugIn plugin, IntPtr pPlugIn, Type commandType, Command newCommand)

Can you guys have a look at your Toolbars plugin and see if it needs some attention to prevent this startup exception?

I track all exceptions in our software and this one is just causing all of our Rhino 8 users to look like they are having crashes…

Thanks in advance,

Jason

I see that, I’ll have that fixed for the next service release. At the same time, exceptions are a valid way of logic control as long as they are caught and handled correctly (as this one is). I think there may be more exceptions being thrown and caught.

https://mcneel.myjetbrains.com/youtrack/issue/RH-81520/

1 Like

I appreciate you fixing this. Congratulations on joining McNeel. I know you and I have been doing the WPF Plugin thing for a long, long, time…

I was always told not to use exceptions for flow control logic. Exceptions should be exceptional, i.e. “Not Expected”. Exceptions when thrown may cause the stack trace to be computed and will cause performance degradation.

Do you think there is new thing, beyond the statements in this article that I should consider: 8.4. Exceptions | Code Complete: A Practical Handbook of Software Construction, Second Edition

Currently we log the exceptions (if any) from Rhino because so often other Rhino Plugins are causing performance issues for our plugin. So we need to be able to track plugin exceptions so we can determine if it is us, or some other logic.

While our Skin is loading we use:
image

And once our plugin is loaded we use:
image

If you have another recommended way of seeing exceptions let me know.