WIP has broken a couple of items in my plugin

Howsit team, two issues in the lastest R9 WIP/Grasshopper:

1/ Invalid Box with negative domain in Z

R8:

R9:

The other one is a little strange, I have an HTTP server written in C# (available on the package manager as DK_Http) - this just fails to receive form data back from the browser.

This is actually the Bengesht Http Server code (R6) recompiled to R8/dotnet 7.0. The Bengesht code actually works FINE in R9 - only the code compiled against the more modern framework fails?

I know its still early days on R9 but thought I’d better test early and often after all of the R7->R8 issues

Cheers

DK

250320_Invalid Box in R9.gh (7.6 KB)

Hi -

RH-86595 Grasshopper: Invalid Box
-wim

1 Like

Hi Guys, I’m still seeing the issue above in the latest WIP R9 - what is the recommended DotNet to compile R9 GH plugins against?

Cheers

DK

Hi @kiteboardshaper,

In looking at DK_Http and trying with a simple example, it crashes with the following stack for me in both R8 and R9:

[ERROR] FATAL UNHANDLED EXCEPTION: ObjectiveCException.NSInternalInconsistencyException: Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.
   at ObjCRuntime.Messaging.void_objc_msgSendSuper_NativeHandle(IntPtr receiver, IntPtr selector, NativeHandle arg1)
   at ObjCRuntime.Messaging.void_objc_msgSendSuper_NativeHandle(IntPtr receiver, IntPtr selector, NativeHandle arg1)
   at AppKit.NSWindow.set_Title(String value)
   at System.Windows.Forms.Form.set_Text(String value)
   at Grasshopper.GUI.GH_DocumentEditor.UpdateTitleText()
   at Grasshopper.GUI.GH_DocumentEditor.Canvas_DocumentModifiedChanged(GH_Document sender, GH_DocModifiedEventArgs e)
   at Grasshopper.GUI.Canvas.GH_Canvas.OnDocument_ModifiedChanged(Object sender, GH_DocModifiedEventArgs e)
   at Grasshopper.Kernel.GH_Document.OnModifiedChanged()
   at Grasshopper.Kernel.GH_Document.set_IsModified(Boolean Value)
   at Grasshopper.Kernel.GH_Document.Modified()
   at Grasshopper.Kernel.GH_Document.DocObjSolutionExpired(Object sender, GH_SolutionExpiredEventArgs e)
   at Grasshopper.Kernel.GH_DocumentObject.OnSolutionExpired(Boolean recompute)
   at Grasshopper.Kernel.GH_DocumentObject.OnSolutionExpired(Boolean recompute)
   at Grasshopper.Kernel.GH_DocumentObject.ExpireSolution(Boolean recompute)
   at Grasshopper.Kernel.GH_ActiveObject.ExpireSolution(Boolean recompute)
   at Grasshopper.Kernel.GH_Component.ExpireDownStreamObjects()
   at Grasshopper.Kernel.GH_ActiveObject.ExpireSolution(Boolean recompute)
   at DK_http.HttpCat.HttpIn.httpHandlerOnChanged(Object sender, EventArgs e)
   at DK_http.HttpHandler.onChanged()
   at DK_http.HttpHandler.startListenning()
   at System.Threading.Thread.StartHelper.Callback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
[END ERROR]

It looks like you’re calling ExpireSolution() from a background thread, but instead should invoke that on the main thread (this is true on both Windows and Mac). I’m not sure if this is what you’re running into, but at least that is a start.

In general, there shouldn’t be any issues running net7.0 compiled code in .NET 9. Rhino 9 on Windows will be able to run in .NET 4.8, 8, 9, and 10 when released, whereas on Mac it will only run with .NET 9 (10 when released).

Edit: This means for Rhino 9 or later, you should target at least net48 and net8.0 to support both platforms and all runtimes. If you want to target Rhino 8 or later, then it would be net48 and net7.0.

Hope this helps!

@curtisw

Thanks for looking into this, what it actually has made me do is look closely at my whole Eto.WebView to GH communication and I’ve got about 90% of the way to a serverless solution - completely doing away with the code above that is not working in R9.

Cheers

DK

1 Like

There we go - now free of the above c# code and actually working better than ever.

Still waiting on the fix for the negative domains input to the box issue - but I see that’s due to be fixed in the next WIP update.

Cheers

DK

RH-86595 is fixed in Rhino WIP

1 Like

Thanks team - looks like between my own code changes and the box bug fix we are now running again in WIP:

Cheers

DK

2 Likes