RhinoCommon "Could not load file or assembly 'RhinoCommon,'

Hello,

I am trying to launch a specific file in Rhino from a C# application built in Visual Studio
It works fine just using Process.Start() but it opens a new instance of Rhino every time.
I would like to have Rhino already running and just have it open the specified file so i don’t have to wait for Rhino to start up every time.
I have tried the Rhino.RhinoDoc.Open()function but I get the following error

System.IO.FileNotFoundException:‘Could not load file or assembly ‘RhinoCommon, Version=6.2620147.6510,Culture=neutral,PublicKeyToken=552281e97c755530’ or one of its dependencies.The system cannot find the file specified.’

I seem to have the latest RhinoCommon installed and seem to have it referenced to my project.

Does anyone have any idea why this isn’t working?

I’m having trouble picturing what you are describing. Do you have some sample code to help show what you are trying to do? I don’t understand how Process.Start is being used.

I have a button where the user types in the job number and detail number. It creates a path
to a .3dm file. That’s where I would run Process.Start() The variable holding the path would be used
as the parameter passed into Process.Start() and Rhino would start and open that file.

string detail = detNum;
        string HermPath = @"F:\CAD\" + jobNum + @"/Model/Hermle/" + jobNum + "d" + detNum.ToLower() + ".3dm";
        string DoosanPath = @"F:\CAD\" + jobNum + @"/Model/Doosan/" + jobNum + "d".ToLower() + detNum + "/" + jobNum + "d".ToLower() + detNum.ToLower() + ".3dm";
        string DoosanPath2 = @"F:\CAD\" + jobNum + @"/Model/Doosan/" + jobNum + "d" + detNum.ToLower() + ".3dm";
        bool HpathExist = File.Exists(HermPath);
        bool DpathExist = File.Exists(DoosanPath);
        bool Dpath2Exist = File.Exists(DoosanPath2);
        bool wasAlreadyOpen = false;

        if(HpathExist == true)
        {

            //RhinoDoc.Open(HermPath, out wasAlreadyOpen);
            Process.Start(HermPath);
        }

So the Process.Start() works, it opens Rhino and loads the file. The issue is we have a lot of things getting
fired off when Rhino starts so it takes a while to load when opening a brand new instance. I would like to be able to just open a new file in an already existing instance of Rhino. My understanding of reading about RhinoDoc.Open is that it would do this. It seems to me(but I’m a rookie) is that it is an issue with RhinoCommon inside my Visual Studio. I have looked at every way that I know how to fix it but am drawing a blank.

That helped a lot, thanks. You may want to investigate using the com object for working with Rhino out of process.

https://developer.rhino3d.com/api/rhinoscript/introduction/external_access.htm

Rhino7 also supports just loading all of Rhino right into your process (Rhino.Inside) which would be another way to tackle this.

Thank-you very much for your help Steve. I will look into those options!