I am facing a problem resolving an assembly for a Gh plugin when running inside revit.
The gh plugin is using a specific version of Newtonsoft.Json, it works fine when loaded in Rhino WIP.
But when its running through Rhino Inside Revit, I am getting assembly conflict with an older version.
How are assemblies being resolved by grasshopper when running inside Revit?
Do I have to resolve conflicts with Revit assemblies myself in a gh_assemblypriority instance?
Hi Ehsan, this is the error message
“Could not load type ‘Newtonsoft.Json.Serialization.ISerializationBinder’ from assembly ‘Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’.”
The version the plugin is using is higher than the logged version. And as I mentioned its also working normally if loaded in Rhino 7 outside revit.
Okay so the GH plugin is using their own Newtonsoft.Json. This is going to be challeging. Try to go the the plugin installation folder and the (backup) remove the Newtonsoft.Json.dll in there. This should force the plugin to use whatever Newtonsoft.Json that is already loaded.
Okay, I just found out that in Rhino 7 the dll I build in the plugin folder is actually not loaded.
This image shows the modules loaded while running in Rhino 7
The two in the first image, where the plugin successfully works, are also loaded when running in Revit, but for some reason the resolved one ends up being the 9.0.0.0 version!
BTW if anyone faces the same problem, specifying the full-name of the assembly and loading it in a class derived from GH_AssemblyPriority resolved the issue.