Unrecognized object when launching Grasshopper externally through C# code

Hi guys, I encountered an issue when writing a script to launch a particular Grasshopper file with a custom Rhino plugin. I am using Grasshopper.Plugin.GH_RhinoScriptInterface to load editor, disable banner and open files, but the Grasshopper instance loaded wouldn’t load all the components, things like Entwine, surface, mesh components are all gone. My code is as below:

Grasshopper.Plugin.GH_RhinoScriptInterface gh;
gh = (Grasshopper.Plugin.GH_RhinoScriptInterface) RhinoApp.GetPlugInObject(“Grasshopper”);
gh.DisableBanner();
gh.ShowEditor();
gh.OpenDocument(“path to the GH file”);

the interface looks like:

This issue doesn’t occur if I use RhinoApp.RunScript(String.Format("_-Open “{0}”", ghScript), false). Am I doing something wrong?

Pretty discouraging when nobody is helping, but I found a workaround.

This works perfectly in python, so I have written a python script that launches Grasshopper, locks solver, opens document, hides editor, and runs solver. In my C# plugin, it just uses “RunPythonScript” command to execute this python code in assembly resource folder.