I’m encountering an issue where my component works fine in Rhino 7 (left), but when loaded in Rhino 8 I get 1. After Solution exception:Object reference not set to an instance of an object.(right)
I’ve tried to run Rhino 8 in debug mode with /netfx switch, but the exception isn’t being caught.
The component is basically a “custom preview component”, it inherits GH_CustomPreviewComponent, so that I can override DrawViewportMeshes and AppendRenderGeometry, I think inheriting GH_CustomPreviewComponent is causing the issue, as I’ve commented out all the code logic so that it’s barebone, and it’s still showing the exception.
Functionally speaking, the component works fine, as far as i can tell, but I would like to know what the exception is.
Yes, it’s basically the same issue, but for me, after disabling “Enable Just My Code” the exception occurs in the the GH_CustomePreviewComponent class, for some reason the base seems to be null in base.AfterSolveInstance()?
So I’m having a bit of an interesting situation, on my work computer, this exception shows up
on my personal computer, with the same gh and gha files, everything is fine
Both computers have the latest Rhino 8 installed, I have a bit more plugins installed on my work computer, but I don’t think that would be the cause (maybe)?
Do you have any suggestions on what I can do to pinpoint the issue?
It happens on components that inherit from GH_CustomPreviewComponent and implement BeforeSolveInstance without calling base type implementation but do call AfterSolveInstance base type method.
If you override BeforeSolveInstance and call base type, you should call base type also on AfterSolveInstance or don’t call base type in any of these two overrides.
Previous versions of Rhino where immune to this issue, but calling those methods in pairs or not calling them at all should work on any version of Rhino.
This error is a different one, it happens during the display and not during before-after solution methods.
Do you mind enable stop on Exceptions on Visual Studio and send a screenshot of the call stack when this happens?