Using Rhino3dm and RhinoCommon for Development

Sorry for posting this before I do my homework. I am writing a class library in .NET standard 2.0 and thought that taking a dependency on rhino3dm would be preferable (I would like my Tests to be running on the latest .NET).

My intention is to use this library in my addin which references RhinoCommon. Because of this I have a clash in references between Rhino3dm and RhinoCommon. Rhino3dm isn’t as complete as RhinoCommon (there seems to be extensions or helper methods which exist on types in RhinoCommon but not in Rhino3dm).

Is the intent of these 2 libraries set up for this purpose? Currently I am referencing RhinoCommon from my .NET standard 2.0 and running my tests on .NET 7 and this works fine (ignoring the warnings about .NET framework). Is it possible to build RhinoCommon for .NET standard?

Hi @Mike26,

RhinoCommon is a Rhino-dependent assembly. That is, much of RhinoCommon does is dependent on the functions build into Rhino. Thus, RhinoCommon cannot be used in a standalone application.

Rhino3dm is build on top of our openNURBS library.

OpenNURBS does not have all of capabilities of Rhino, thus the differences between it and RhinoCommon.

If you are working in Rhino, use RhinoCommon. If you are working independent of Rhino, use Rhino3dm.

— Dale

1 Like

Thanks, and makes sense. Can I ask if there is a need to build RhinoCommon against .NET Framework 4.8? can a .NET standard build be done or does it require the Framework runtime (and various APIs non-existent in .netstandard)

Hi @Mike26,

Rhino 7’s RhinoCommon is built against .NET Framework 4.8. Sorry, I don’t know about all the other .NET incantations.

Why do you need .NET Standard?

— Dale

It doesn’t seem to a major as I am building my tests project against .NET 7. For my tests project I would rather keep to the latest cross platform .NET (such that we could run tests on linux runners in our CI/CD).

I expect I could get into trouble if there are .NET Framework specific APIs I invoke but currently I don’t appear to be doing so…

Do you no longer host the RhinoCommon repo open on github? This is archived mcneel/rhinocommon: RhinoCommon is the .NET SDK for Rhino5 / Grasshopper (github.com)

It is folded into GitHub - mcneel/rhino3dm: Libraries based on OpenNURBS with a RhinoCommon style (this folder specifically)