C# Class library built into .dll failed to load in grasshopper

(Petras Vestartas) #1


.dll failed to load in grasshopper c# component:
//Import failed for ‘C:\Users\Petras\Documents\Visual Studio 2017\Projects\Test01\Test01\bin\Debug\netstandard2.0\Test01.dll’: Could not load file or assembly ‘netstandard, Version=, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The system cannot find the file specified.

Probably, I am missing something very simple when creating C# library as .dll.

To simplify:

The following screenshots shows steps in visual studio; creating test C# static class and building it to .dll.

Grasshopper cannot load that .dll. What kind of project it must be in visual studio 2017, so that .dll could be loaded?

(Laurent Delrieu) #2

I did that

(Petras Vestartas) #3

Hmm, before in Visual Studio 2015 I was doing the same as described in my screenshots and it was working.

Similarly as you I can also achieve this with grasshopper template, to create a) components plugin b) and .dll for all the methods and classes and it is working good.

But I also want to make separate .dll libraries without template file.

Wondering what has changed in 2017 in visual studio

(Petras Vestartas) #4

Och found it how to do it in 2017 vs. I was lost in many different types Class Libraries.

When you download visual studio 2017 you do not have this Class Library (Framework) by default, you have other such as Class Library (Standard) or Class Library (Universal Windows)

So I had to download visual studio installer again, press modify and install Class Library (Framework)

After it is install you see this and you can compile your static classes to .dll that is what grasshopper is able to read: