Hi,
I use Rhino.Inside to run scripts in the background while I keep working in Rhino 9. Every time the background process starts, my open Rhino loses its license within about a minute. I get “Unable to refresh license for Rhino 8”, then “The license for Rhino 8 has been voided”, then a “Save changes?” prompt with only Yes/No, and Rhino closes. This is on Rhino 9 BETA 9.0.26258.12303, Windows 10, with a Cloud Zoo license.
I think it’s the same problem as this thread from last year, and I believe I’ve found the cause.
What’s going on
Rhino ships two copies of System.Management.dll:
System\netcore\runtimes\win\lib\net8.0\System.Management.dllis the real Windows version.System\netcore\System.Management.dllis a placeholder that just throws “not supported”.
Rhino.exe uses the real one. A Rhino.Inside process gets the placeholder, because the resolver (Resolver_NetCore.cs, GetSearchPaths()) only looks in System\netcore and System.
Without the real one, the Rhino.Inside process can’t read the PC’s hardware serial number, so it gets a different HostUtils.DeviceId than my open Rhino. As far as I can tell, Cloud Zoo then thinks the license is being used on a second computer and voids the session on my open Rhino.
What I’ve checked:
- The device ID in the Rhino.Inside process doesn’t match Rhino.exe’s. When I load the real DLL first, they match.
- With that fix, I’ve run Rhino.Inside next to my open Rhino for several minutes, including creating geometry and saving a 3dm, with no license problems.
- It happens on .NET 9 and .NET 10, from Python (
rhinoinside) and from a plain C# app. Running Rhino.Inside on .NET Framework 4.8 didn’t cause it.
Workaround
Load the real DLL yourself before starting RhinoCore:
AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.Combine(
RhinoInside.Resolver.RhinoSystemDirectory, "netcore", "runtimes", "win", "lib", "net8.0", "System.Management.dll"));
or in Python, after the .NET runtime is loaded:
System.Reflection.Assembly.LoadFrom(r"C:\Program Files\Rhino 9\System\netcore\runtimes\win\lib\net8.0\System.Management.dll")
Suggested fix
On Windows, have the resolver check netcore\runtimes\win\lib\... before netcore\. That matches what Rhino.exe gets from dotnetstart.10.deps.json. Ten other Windows-only DLLs in that folder have the same placeholder problem, so they’d be fixed too.
Thanks!