I have been trying to get Rhino 8 to run in Rhino.Inside mode as part of a unit testing project, and have failed to get it to work when the tests run on the .Net 7 runtime.
I have replicated the issue in a small console app project that is very similar to the rhino developer samples on Github but with extra console logging (see attached).
This is the output when run on .net framework (it works):
App starts
CLR version: 4.0.30319.42000
Rhinocommon info: RhinoCommon, Version=8.15.25019.13001, Culture=neutral, PublicKeyToken=552281e97c755530
Resolver.FindRhinoSystemDirectory: C:\Program Files\Rhino 8\System
HostUtils.RhinoAssemblyDirectory: C:\Program Files\Rhino 8\System
About to call RhinoCore ctor
RhinoCore ctor returns successfully
Running in netfx
Created sphere mesh, total vertices = 8385
This is the output when run on .net 7 runtime (it crashes when call the RhinoCore constructor):
App starts
CLR version: 7.0.20
Rhinocommon info: RhinoCommon, Version=8.15.25019.13001, Culture=neutral, PublicKeyToken=552281e97c755530
Resolver.FindRhinoSystemDirectory: C:\Program Files\Rhino 8\System
HostUtils.RhinoAssemblyDirectory: C:\Program Files\Rhino 8
HostUtils.RhinoAssemblyDirectory != Resolver.RhinoSystemDirectory
About to call RhinoCore ctor
C:\path\to\rhino-inside-bug\RhinoInConsole\bin\Release\net7.0-windows\RhinoInConsole.exe (process 43556) exited with code 3 (0x3).
I noticed that HostUtils.RhinoAssemblyDirectory pointed one directory up when in .net 7 mode, which doesn’t seem correct.
Is there anything I am missing, or is this a bug?
rhino-inside-bug.zip (3.6 KB)