Running .NETStandard 2.0 .dll within a C# scripting component

Hello all,

I am trying to run a .NETStandard .dll within a grasshopper C# Script Component by adding the .dll as a reference (i.e. through right-click Manage Assemblies).

Unfortunately, I get the following compilation error message as a warning:
“1. Error (CS0012): The type ‘System.Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. (line 60)”.

Am I right in thinking that the C# component does not do the compiler magic that is required to map .NETStandard v2.0 into Framework? Is it at all possible to do this?

Outside of the C# script component, using .NETStandard v2.0 seems to work well. I have been writing a Grasshopper plugin using the same .NETStandard v2.0 library and this seems to work well, when it is being compiled in visual studio. What is being done differently?

Hi Nick,

I’m having the same issue. Did you figure this one out?

Thanks!

Thanks to the awesome @alan2 this has been figured out…

We need to reference netstandard.dll - can be found here:

“C:\Windows\Microsoft.NET\assembly\GAC_MSIL\netstandard\v4.0_2.0.0.0__cc7b13ffcd2ddd51”

Also found on the Speckle docs (Grasshopper | Speckle Docs)

1 Like