Plugin built with .NET 7.0 crashes on Rhino 8 Windows

Hello,

I try to change our plugin project from .NET framework 4.8 to .NET 7.0 to fit for Rhino 8 better and especially because I can not build it for Rhino 8 under OSX in the old format.

After the necessary changes the plugin builds fine, but it crashes pretty soon on certain operations.
One typical operation is when it tries to use RenderContent Fields.

For example:
renderContent.Fields.Add(“myField”,1);

RhinoCommon sends this:

Any idea why this error happens?

Thanks,
Márton

Quick check: have you switched the .NET runtime with SetDotnetRuntime command in Rhino?

I am on default mode in Rhino8.

If I type in Rhino the SetDotnetRuntime command
it returns with:
Currently running .NET in NETCore

But I think the problem is probably on my side.
If I build the plugin with the new settings for Rhino 7, and in this case in the .csproj file I use
<TargetFramework>net48-windows</TargetFramework>

Rhino 7 crashes at the same place.

Márton

I have found what went wrong with my new settings.

Inside the .csproj file I had to add
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

otherwise AssemblyInfo.cs is ignored and Net core generates one in build time.

1 Like