Compiling Grasshopper Component using C# in VS2019


I’m creating a new grasshopper component using c# in VS2019. The c# code uses an external library that I’ve imported under Resources in the code solution, and added with “using” in my code base. The library I’m using is MathNet. Is there a way to bundle this external library with my grasshopper component when I compile so that I only need to move the .gha file into Grasshopper Libraries to run it and don’t need to move Mathnet.dll into the folder as well?

Thanks in advance for any help


You can make a “Build event” in VS which copies both the gha-file and the MathNet.dll to the Grasshopper Library when you press “Build” in VS.

// Rolf

Thanks! That works for me locally when compiling but is there a way to bundle the .gha and the MathNet.dll into one package? I’m trying to send this component to someone else and would like to limit the amount of overhead work.

Yak (the Rhino Package manager) supports bundling of multiple files into a single package.