How to fix ‘type load exception’ when loading a Grasshopper component
As mentioned previously, I’ve been working in James’ territory on a Grasshopper component as part of my research. The tool is now ready for testing and as such, I gave copied of the .gha file and background .dll file to a colleague to test on their machine. However, instead of loading the component, Grasshopper threw a ‘type load exception’ (see image below) and refused to load the component.
How to fix
The way to fix this error is to uncheck the COFF settings in the Grasshopper development settings panel. You find this by typing “GrasshopperDeveloperSettings” into the Rhino command line and you should see the box below.
Uncheck the ‘Memory Load *.GHA assemblies using COFF byte arrays’ checkbox (so that your box looks like the one below) and reopen Grasshopper (there doesn’t seem to be a need to close Rhino and re-open it, so you can get away with simply opening Grasshopper).
Hopefully you should now be able to load your Grasshopper component without it throwing a ‘type load exception’ error. Let me know in the comments if this works for you or, perhaps more critically, does not work as a fix for you. The mystery may yet thicken…