Emu: error message

I just installed Emu on Rhino 8 on macOS via the package manager and got the following error when placing an Emi component onto the canvas:

@emilpoulsen any ideas?

The plugin looks amazing otherwise, I am looking forward to trying it out!

Cheers,
Rudi

1 Like

Thanks @rudolf.neumerkel for reporting. Emu hasn’t been tested om macOS, but should theoretically work… Hard to tell what’s going on based on the screenshot. Does this happen for all Emu components? Would it be possible for you to test it on Rhino 7?

Very interesting, it works fine on RH7.

Also tried out launching it with Rhino 8 under Rosetta (I am using an AppleSilicon Mac), but it also didn’t work.

Maybe @curtisw has some ideas?

1 Like

Appears it’s because Emu is calling Thread.SetApartmentState(), which is a windows-only call. It may have worked in Rhino 7 as mono probably did something else (or nothing) instead of throwing an exception, whereas Rhino 8 on Mac uses .NET Core.

The call stack there unfortunately does not show the actual call stack as the exception is not passed on. In fixing that, it shows this error, which is more relevant:

There may be other calls that aren’t supported, but it would be worth removing that call (or only calling it on Windows) may get things working… assuming there’s no other COM calls.

Hope this helps!

1 Like

Thanks for the hint @curtisw!

@rudolf.neumerkel, I’ve published a new version 1.3.2 of Emu on Yak, which excludes the call to Thread.SetApartmentState(). Can you give this a shot now?

1 Like

Awesome update @emilpoulsen!

I can’t say everything is operational, but at least Emu components can be dragged on the canvas now without error.

2 Likes

Thanks, @curtisw! :pray: Do you know where I can find the tool for testing the compatibility of a GH plugin with the new Rhino 8/.NET Core runtime? I have a vague memory of it existing, but can’t recall where…

Hey @emilpoulsen,

Information about running compat is here, however in this particular case you wouldn’t find it as the API exists, it just throws an exception on Mac so it won’t give you any information about that.

One way to know before you release would be to multi-target your plugin for both net48 and net7.0 which would give you compile errors or warnings if APIs aren’t available on all platforms.

We are working on our project templates for VS and dotnet new so that you can see a bare bones setup of how that would work and also support older versions of Rhino. That should come out shortly!

Cheers,
Curtis.

thanks a lot, gave it a quick try - the example file worked fine!
Will test it out a bit and report back if I find any more bugs

cheers,
Rudi