algorithmic modeling for Rhino
I created a Rhino plugin that referenced another DLL.
Later I created a GH component referencing another version of the DLL.
At runtime the GH component referenced the DLL from the Rhino plugin. Even after uninstalling the plug-in, I had to recompile it with the new version of the DLL to get the GH component working.
I checked the Windows GAC and that DLL is not there.
Tags:
Rhino does not put anything inside the GAC, nor does it maintain its own version of a GAC. If you install a plugin using an RHI package, then the contents will be copied into the appdata folder somewhere, and you'll have to manually delete files from there if you wish to uninstall any of it.
Rhino (and Grasshopper) do use an assembly lookup algorithm which iterates over all the places where a requested DLL may reside. This includes all plugin folders, so if a dll is in there, it may be loaded before the one you actually want gets found.
Is that what may be happening here?
quite likely that's what's happening.
it's good to know, anyway
Hi David, I have a similar issue. how can I make sure Rhino is using the dll in the same folder as the rhp file ? and not a dll with the same name in another plugin folder ?
You can enforce a specific dll by loading it yourself. But even if you do this as soon as possible, there's no guarantee the appdomain won't have already loaded a different version of that dll.
Have a look at Assembly.LoadFile or Assembly.LoadFrom. I can never remember which of these is the one you're supposed to use.
Thanks for the advice David, the problem was related to FSharp.Core. It went away after installing Visual Studio 2017. ( but I am sure it will come back on another PC without VS, then I will try your advice...)
Hi David, It seems the appdomain is already loading he older dll before I do Assembly.LoadFile(..).
Do I then need to use reflection for all method calls on the desired assembly ?
I also posted this here: https://discourse.mcneel.com/t/how-to-ensure-my-rhino-plugin-loads-...
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by