RhinoCore dispose

I’m getting a popup with the “The plug-in with id -guid- was unloaded incorrecty” error, where the guid indicates Grasshopper. In my case, I’m loading a gh document, run it few times and the parent application shuts down (WPF app if that matters). My code follows the rhino inside developer samples (below):

Ok, that only happened because I was running RhinoCore with the “–appmode” argument. Changed it to “/nosplash” and it works as it should.

RhinoCore = new RhinoCore(new string[] { "/nosplash" }, Rhino.Runtime.InProcess.WindowStyle.Hidden, mainWindowHandle);