Gh ignores dev .dll, uses installed package version instead

My workflow for plugin development adds the build folder for the development version to the Library Folders (accessed via the GrasshopperDeveloper command), like so:

This allows me, when I start GH, to choose between the package version and the current dev version of a plugin without too much hassle.

This setup worked fine until today. One plugin in particular (Assembler) has both a .gha and a .dll; usually, when picking the dev version, all testing and debugging (starting Rhino 8 via Visual Studio) worked smoothly. Today, I realized this is not the case anymore, and, while the dev .gha version is loaded, it seems that Grasshopper picks the .dll from the installed package directory instead of the one in the dev directory; I know because I introduced a new field in the dev .dll and GH says that it does not exist (AssemblerLib is the .dll library):

If I uninstall the Package Manager version, everything works fine (as expected).

I believe this might be a regression; could some developer try if this is a general behaviour or if it’s happening only to me?

Bumping this up. Anyone?

Hi @ale2x72,

When you say until today, means that some weeks ago was working? Did you update Rhino during this period?
What version of Rhino are we talking about?
I’m not aware of any change on this regard, but I’m surprised this worked smoothly before.

If I understood this correctly you have both versions of the same plugin installed at the same time and you use the plugin conflict dialog to decide which one to load each time Grasshopper is launched.
This will work for .gha that do not depend on a .dll next to it, but there is nothing than warrantees the .dll next to it is loaded if another one with the same name is available before on the ‘Library Folder’ list or already loaded.
You can see a more complete list of folders used to search for .dlls if you click on topo-right button ‘Valid Folders’.

If your .dll is referenced from the .gha using attributes, adding this line into the .gha may help in this case.

[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.UseDllDirectoryForDependencies | DllImportSearchPath.System32)]

Hi @kike, I posted the same day I noticed this behaviour, and I’m sure this setup worked in the past since I’ve been testing multiple changes to the .dll that should have triggered a similar error, although I cannot pinpoint the exact moment things have changed. For sure Rhino has been updated, I keep it on the last Service Release (current is v8 SR32… EDIT: SR33, I got an update notification right after I posted this reply)

Yes, one is the PackageManager installed version, the other is not exactly “installed”; I use the Developer Settings to point at the bin folder. When GH starts, I use the conflict dialog to choose which one to load.

I found the button, and the bin folder witrh the developer version is listed, but I have another question (possible UI bug): why is the interface for that header dark grey with black text? It’s almost impossible to read. I think it might be the result of a mixup between Rhino in dark mode and Grasshopper (which is light-mode only).

This is new to me: I thought each .gha searched the .dll libraries first in its own folder, as (a long time ago) David Rutten suggested here (“Put all your files into a subfolder of the Libraries folder”): https://www.grasshopper3d.com/forum/topics/grasshopper-library-folders?overrideMobileRedirect=1
And my experience (up to this issue) matched this impression.
The .dll is referenced as a dependency of the .gha directly in the Visual Studio project.

I understand the confusion, but ‘Putting all your files into a subfolder of the Libraries folder’ just implies this folder is used for assembly resolution but does not tell anything about any priority based on proximity on the hard drive.

Current implementation, since 2022, use following rule to solve dependent assemblies when there is a conflict like yours.

The assembly with the most recent assembly version on its AssemblyName is used, in case of both assemblies have also same version the latest assembly saved on the hard drive is used.

I totally understand your expectation but is not how it works.
We may try to improve this in v9, but this is something that can’t be change at this point on v8.

Ok, this is already useful. The latest version I’m testing is an upgrade from .NET Framework to .NET Core, and in another plugin I’ve noticed variables such as AssemblyVersion , AssemblyName, etc. that need attention (and I haven’t checked them yet). It might be that, in the upgrade process, the .dll version number reverted to 1.0.0, which might be the reason why it was not the one being loaded. I’ll have to check (can’t do it right now), and I’ll let you know if that was the culprit,

@Kike Confirmed: in the upgrade to .NET Core, the .dll’s AssemblyVersion reverted to 1.0.0. By changing that value to match the dev version of the plugin, the correct .dll version is loaded. Thanks for the tip!