Troubleshooting plugin in rh6 wip

I’m getting the following error loading a plugin that worked fine in Rhino Mac 5.x:

An error occured during GHA assembly loading: Path: /Users/andrewheumann/Library/Application Support/McNeel/Rhinoceros/6.0/Plug-ins/Grasshopper (b45a29b1-4343-4035-989e-044e8580d9cf)/Libraries/WombatGH.gha Exception System.Reflection.ReflectionTypeLoadException: Message: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.

here’s the GHA in question: WombatGH.gha (170.5 KB)

Any guidance on how best to track down the issue? If possible I’d love to avoid having to build it anew on the mac to debug… In the past I’ve had trouble migrating windows project solutions over to Mac and successfully debugging without starting a new project and copying over code :confused:

Sounds like we broke something. Curtis has been working hard to unify the GH codebase so Mac 6 can be based off of Windows V6 GH. I’m not surprised if something broke in the process. I’m out of the office until Tuesday and won’t be able to check until then. Was this component specifically compiled for V5 Mac or was it compiled on Windows and “just worked”?

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

compiled on windows and just worked!

That’s the best case, thanks.

That sounds like the component is compiled with RhinoWindows as a reference. Something Windows OS specific anyway.

That won’t work, you’ll have to find a way to get the component working without RhinoWindows.

Andrew mentioned that this component works in Mac V5 so it isn’t using anything Windows specific

1 Like

Right, I missed the word Mac, I read Rhino 5.x. Anyway, this is a message that also appears when referencing RhinoWindows, hence my confusion.

@andheum I am able to reproduce this on my Mac. For some reason the runtime is being fussy and whining about not being able to find VectorComponents when we load wombat and inspect the assembly for exported types. I think I can work around this and get most of the components to show up.

This should be fixed in the latest RhinoWIP. Give it a whirl.

1 Like

Hey dudes (@stevebaer @dan) - I have another issue like this one - a component that fails to load in rhino 6 WIP for mac but works fine on Rhino 5 mac and Rhino 6 windows. It’s the “Loft Ex” component in Wombat (Same GHA as above). I suspect the issue is that the component references a class defined in another component assembly (SurfaceComponents.GHA) rather than grasshopper core - I’m relying on the “LoftOptions” param type as one of the inputs.

Here’s the load error:

Object: LoftEx (level 1)
{
  Exception has been thrown by the target of an invocation.
  TargetInvocationException
  System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'SurfaceComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' or one of its dependencies.
  at Grasshopper.Kernel.GH_Component.PostConstructor () [0x0000d] in <ee021d3465244a6cb0b464c989ca014d>:0 
  at Grasshopper.Kernel.GH_Component..ctor (System.String name, System.String nickname, System.String description, System.String category, System.String subCategory) [0x0005b] in <ee021d3465244a6cb0b464c989ca014d>:0 
  at WombatGH.LoftEx..ctor () [0x00000] in <052ed205493140888063adcb0029155e>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <dfbd917c5f114caab5722f99000cdb68>:0 
   --- End of inner exception stack trace ---
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <dfbd917c5f114caab5722f99000cdb68>:0 
  at Grasshopper.Kernel.GH_ComponentServer.LoadDocObject (System.Type T, Grasshopper.Kernel.GH_AssemblyInfo assembly, Grasshopper.Kernel.GH_GuidConflictSolution& conflictSolution) [0x00000] in <ee021d3465244a6cb0b464c989ca014d>:0 
}

Object: LoftEx (level 2)
{
  Could not load file or assembly 'SurfaceComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' or one of its dependencies.
  FileNotFoundException
  System.IO.FileNotFoundException: Could not load file or assembly 'SurfaceComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' or one of its dependencies.
File name: 'SurfaceComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803'
  at Grasshopper.Kernel.GH_Component.PostConstructor () [0x0000d] in <ee021d3465244a6cb0b464c989ca014d>:0 
  at Grasshopper.Kernel.GH_Component..ctor (System.String name, System.String nickname, System.String description, System.String category, System.String subCategory) [0x0005b] in <ee021d3465244a6cb0b464c989ca014d>:0 
  at WombatGH.LoftEx..ctor () [0x00000] in <052ed205493140888063adcb0029155e>:0 
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <dfbd917c5f114caab5722f99000cdb68>:0 
}

Thanks for reporting this. We’ll take a look soon. Logged in:

RH-50354 Grasshopper: Third-party WombatGH component throws exceptions

Wombat should work in the latest RhinoWIP :partying_face: :australia:

2 Likes