When I start the app, I get: “Rhino license manager initialization failed with error 0. Rhino will not run.”
If I change WindowStyle to NoWindow, the error becomes a COMException E_FAIL at new RhinoCore(...).
This happens whether Rhino 7 is already open or closed.
What I’ve tried
Only Rhino.Inside package; removed any direct references to RhinoCommon / RhinoWindows (and removed any copies from bin).
Followed Ehsan’s guidance for WPF entry point (use a custom Program.Main, call RhinoInside.Resolver.Initialize()before touching any Rhino types; don’t set PATH or change CWD).
First run with WindowStyle.Normal (not Hidden/NoWindow), to allow license UI if needed.
Cleared env vars that might interfere: RHINO_PLUGIN_PATH, RHINO_COMMON_DIR, RHINO_LICENSE_METHOD.
Cleaned bin/obj, repaired Rhino 7 installation.
Confirmed Rhino 7 launches normally outside my app (license OK).
Questions
Are there known causes for “license manager initialization failed with error 0” when hosting Rhino 7 via Rhino.Inside?
Is there any additional requirement for the License Manager plug-in to load under Rhino.Inside (e.g., specific env vars, plugin path assumptions)?
public partial class App : Application
{
private RhinoCore? _core;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var sys = @"C:\Program Files\Rhino 7\System";
if (!File.Exists(Path.Combine(sys, "RhinoLibrary.dll")))
throw new InvalidOperationException("Rhino 7 not found.");
var path = Environment.GetEnvironmentVariable("PATH") ?? "";
if (!path.Split(Path.PathSeparator).Any(p => p.TrimEnd('\\').Equals(sys.TrimEnd('\\'), StringComparison.OrdinalIgnoreCase)))
Environment.SetEnvironmentVariable("PATH", sys + Path.PathSeparator + path);
Environment.SetEnvironmentVariable("RHINO_SYSTEM_DIR", sys);
Directory.SetCurrentDirectory(sys);
RhinoInside.Resolver.Initialize();
var args = new[] { "/NOSPLASH", "/NOTEMPLATE" };
_core = new Rhino.Runtime.InProcess.RhinoCore(args, Rhino.Runtime.InProcess.WindowStyle.Hidden);
new Views.MainWindow().Show();
}
}
I am developing a WPF application that integrates Rhino using Rhino.Inside.
I managed to create the app, load the RhinoCore, and host a ViewportControl inside a WindowsFormsHost. The control shows up, but it never renders (stays gray, Paint event never fires).
I have already tried initializing RhinoCore with -embedded, -appmode, /NOSPLASH, creating the App instance before RhinoCore (as suggested), and even delaying the WorkspaceView creation until RhinoCore is active. Still, the ViewportControl does not draw anything.
using System;
using System.Windows;
using Rhino;
using RhinoInside;
namespace RhinoWpfTest
{
internal class Program
{
[STAThread]
static void Main(string[] args)
{
// 1. Enable Rhino resolver before anything touches RhinoCommon
RhinoInside.Resolver.Initialize();
// 2. Start WPF application
var app = new App();
app.InitializeComponent();
// 3. Start RhinoCore in embedded mode
_core = new Rhino.Runtime.InProcess.RhinoCore(
new string[] { "/NOSPLASH", "-embedded" },
Rhino.Runtime.InProcess.WindowStyle.Hidden);
// 4. Run main window
var mainWindow = new MainWindow();
app.MainWindow = mainWindow;
mainWindow.Show();
app.Run();
_core.Dispose();
}
private static Rhino.Runtime.InProcess.RhinoCore _core;
}
}
using System.Windows;
using RhinoWindows.Forms.Controls;
namespace RhinoWpfTest
{
public partial class MainWindow : Window
{
private ViewportControl _vp;
public MainWindow()
{
InitializeComponent();
// Attach Rhino viewport
_vp = new ViewportControl
{
Dock = System.Windows.Forms.DockStyle.Fill
};
Host.Child = _vp;
}
}
}
With this minimal example, the ViewportControl shows up but does not render anything (stays gray, no Paint event).
What is the correct and minimal way to initialize RhinoCore inside a WPF application so that the ViewportControl actually renders?
Is there an official boilerplate for this scenario (WPF + Rhino.Inside + ViewportControl)?
System.DLLNotFoundException: Unable to load DLL ‘RhinoLibrary’. The specified module could not be found. (Exception from HRESULT: 0x800700E). This exception was originally thrown at this call stack: Rhino.Runtime.InProcess.RhinoCore()
I just created a controller application or a WPF project using Visual Studio, and the issue remains the same. Could you please send me a simple, runnable WPF project example? Thank you so much!