Cannot load assembly

Hi Guys,

I currently have 2 projects under the same solution file in Visual Studio. One where I have all my classes and namespaces and the other project is specifically to integrate it with Grasshopper. In my current class that inherits from GH_Component I am referencing my .dll Assembly for usage. I have a small issue which is when I build the Component, Grasshopper cant find my .dll Assemebly. A very bad work around that I am doing at the moment is to copy paste the .dll in to the special folders. I want to know how can I make Grasshopper automatically recognize the .dll. I have tried some solutions offered here Coff and Grasshoppper but it did not seem to work. I also added

[assembly: Grasshopper.Kernel.GH_Loading(Grasshopper.Kernel.GH_LoadingDemand.ForceDirect)]

in to the AssemblyInfo.cs of each project but it didn’t work either.

Just for some illustration…

using SharpMatter.SharpField; // When the component loads in grasshopper it cant find this assembly


namespace SharpMatter.SharpMatterGH.Components
{
    public class ReactionDiffusion2D_GH : GH_Component
    {

        SharpField2D<double> sharpField2D;

/////// bla bla

Any clues would be great.

Thanks

Nicholas

Is that dll located in the same folder as the gha file?

Hi David,

thanks for your reply. Yes, when I build from VS, 2 copies of the .dll are made, one in the SharpMatterGH project and one in the SharpMatter project In the images you can ignore the SharpMatterGH.gha file, now I am building it directly to AppData\Roaming\Grasshopper\Libraries
.

If you build both .dll and .gha files to the grasshopper libraries folder it should work.
As it is the only way the grasshopper load the files.

Hey Petras,

Indeed, that was the solution, should have thought about that one!