Unit testing with Rhino Inside

I read this post about unit testing and used Rhino Inside 7.0.0 for my unit testing project.

My project under test was using rhinocommon 7.4 but since RhinoInside uses rhinocommon 7.0 I had to set that on my project under test as well.

After doing that, I am getting this error on my project under test when I try to access the Filename property on a RenderTexture object.

Severity Code Description Project File Line Suppression State
Error CS1061 ‘RenderTexture’ does not contain a definition for ‘Filename’ and no accessible extension method ‘Filename’ accepting a first argument of type ‘RenderTexture’ could be found (are you missing a using directive or an assembly reference?)

Why am I seeing this error. Is it that in RhinoCommon version 7.0 this property was not defined?

Is there a way to a more latest version of RhinoCommon with the RhinoInside package? @dale @Alain

That property was indeed added in 7.4

Is there any plan to add support for more recent versions of RhinoCommon in RhinoInside?

@Alain

The dependencies of Rhino.Inside 7.0.0 are listed on nuget.org and are as follows:

    .NETFramework 4.8
        Grasshopper (>= 7.0.20314.3001)
        RhinoCommon (>= 7.0.20314.3001)
        RhinoWindows (>= 7.0.20314.3001)

This means that any RhinoCommon newer than 7.0 will work with Rhino.Inside, you just have to set it to the required version. Personally, I put the PackageReference to RhinoCommon in a shared targets file that is imported in each project that uses RhinoCommon, so I can control the version of RhinoCommon in one central location.

What’s more is that Rhino.Inside will even load Rhino 8, if you tell the Resolver to use the latest Rhino version installed:

RhinoInside.Resolver.UseLatest = true;
RhinoInside.Resolver.Initialize();
2 Likes