mcneel / rhino.inside

Sample Projects for Rhino.Inside
MIT License
384 stars 168 forks source link

Following Unity setup as instructed fails to find rhino library dll #25

Closed secretlyagoblin closed 5 years ago

secretlyagoblin commented 5 years ago

Not sure if there's something wrong with my setup or not, thought I'd raise it just in case it's occuring fo multiple users.

  1. Installed latest Rhino WIP ,
  2. Installed Unity 2018.3.0f2 Personal,
  3. Ran .bat file in the project before opening project, successfully moved RhinoCommon into the folder
  4. Opened project using the Unity Hub

Getting the following error: System.DllNotFoundException: RhinoLibrary at (wrapper managed-to-native) Rhino.Runtime.InProcess.RhinoCore.Startup(int,string[],Rhino.Runtime.InProcess.RhinoCore/StartupInfo&,intptr) at Rhino.Runtime.InProcess.RhinoCore..ctor (System.String[] args, Rhino.Runtime.InProcess.WindowStyle windowStyle, System.IntPtr hostWnd) [0x0011b] in <994a089de5654759821e86b47bc9444f>:0 at Rhino.Runtime.InProcess.RhinoCore..ctor (System.String[] args, Rhino.Runtime.InProcess.WindowStyle windowStyle) [0x00000] in <994a089de5654759821e86b47bc9444f>:0 at RhinoInside.Unity.Startup..cctor () [0x00068] in C:\Users\Chris\Repos\Rhino Inside\Unity\Sample1\Assets\Standard Assets\RhinoInside\Unity.cs:25 UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()

kike-garbo commented 5 years ago

The sample assumes your %ProgramFiles% var points to C:\Program Files and that Rhino is installed there in the folder "Rhino WIP". You can see in the Unity.cs file in the static constructor of class Startup setting up the PATH environment variable to tell Windows where to look for missing dlls. Rhino is there because you said the .bat worked, but could you please check the %ProgramFiles% var points to the same place?

I see that you use same Unity version (2018.3.0f2) this is fine. I'm using Rhino version (7.0.18352.6055, 2018-12-18), but any lately version should work. Could you please tell me the exact version in your case anyway?

My Windows version is [10.0.17134.472] Pro Workstation. What Windows version are you using? is it a server version?

If you have same versions of the three components then it should be a configuration issue. First I want to be sure we have an equivalent setup, then we can check if is a configuration issue what makes the difference.

kike-garbo commented 5 years ago

I did a change in the way I update the PATH var, it may fix your problem.

Could you please test it and tell me?

secretlyagoblin commented 5 years ago

Working perfectly now! Thanks so much. Looking forward to playing around with this at work when I get back from the Christmas break...

image