Rhino crashes after plugin install

Hello Discourse.

I’m developing a plugin and I created an rhi installer. On a reboot of Rhino the plugin attemps to install but crashes. Everything seems to work fine after this. The plugin is correctly installed. But it doesn’t look very professional. I’m running Win10, with the latest Rhino 7 version. Below is the error if I am running Rhino in Debug mode from VS.

Any help in debugging this is very helpful as I’m not sure what to do now.

  Message=UCEERR_RENDERTHREADFAILURE (Exception from HRESULT: 0x88980406)
   at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
   at System.Windows.Media.MediaContext.CompleteRender()
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

  This exception was originally thrown at this call stack:
    [External Code]

– Callum

@will - is this something you can help with?

1 Like

Hey @csykes, are you still having this problem? Can you share your RHI with us as well as the source code for your main PlugIn class, if possible? You can send them privately if you like.

I suspect that this isn’t a problem with the installation, but I’d like to test the RHI to rule this out! I think it’s more likely to be some code that’s being called when the plug-in is first loaded, hence wanting to take a look at the main PlugIn class.

1 Like

After @will’s help I can say the issue was putting code inside the PluginConstructor.
I have moved it into the OnLoad override method and everything now works perfectly :slight_smile:

1 Like