Grasshopper

algorithmic modeling for Rhino


hi guys


hope somebody can help out ;)

we are writing a plugin and have referenced NDde.dll in visual studio and when we drag the component onto the canvas we get this error,but the dll is @ the right place and everything looks fine....maybe someone has an idea why ....david, giulio?




Views: 420

Replies to This Discussion

Is the dll in the develop settings folder specified when rhinocommand _developsettings entered in Rhino.
solved.... *.dll has to be in the grasshopper folder
strange but all other places do not work ... think their is a override
Looking forward to this!
if you have a wish or idea let me know.....
This is a bug in Grasshopper. Or rather, I should be smarter about handling dll requests.

If you disable the COFF loading in _GrasshopperDeveloperSetting, does it work then?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
haha, to], you're a genius about placing the .dll in the proper place. I was using COM as well..David this fixes my problem as well!

Best regards,
Ben
Hi Thomas,

if this happens, it might mean that the .dll is not installed in the GAC. Because of administrator rights, you cannot generally put it in there yourself from Grasshopper.

This is how you could bypass this problem and make the runtime find and load that .dll even if you cannot/do not want to distribute NDde.dll.

- In the component static constructor, handle the AssemblyResolve event: AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(HelpResolveDll);
where HelpResolveDll is a static method that checks that the runtime is really looking for that .dll ("NDde.dll, Version=..."), then loads it with Assembly.LoadFrom(fullPath). fullPath is the full path where you know for sure that the .dll is located. Do you know this in general?

- In your code, defer the loading of NDde.dll to the SolveInstance() part (this is accomplished by not referencing any type in that .dll in other methods).

I know this is a bit of extra coding, but it works.
I hope this is helpful,

- Giulio
Hey Giulio, hope you're well.

Thanks for posting this, I interact with my rhino plug-in assembly from the Grasshopper assembly, and it seems I need to use this technique for v0.7 as simply duplicating the dll in the Grasshopper components folder would load a new instance of the assembly rather than the existing..

Cheers,

Jon

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service