Unable to load DLL 'rhcommon_c'

Hi All,

As a user of Rhino and VisualStudio.Net, I was pleased to learn that Rhino Inside should make it possible to add Rhino functionality to your own applications.

In the current case, I would like to develop a standalone application that creates and saves geometry.

Unfortunately, all attempts to do so result in the following exception:
Unable to load DLL ‘rhcommon_c’: A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)

What has been done so far:

  • Installed Rhino 7 (trial license).

  • In VisualStudio: loaded NuGet package “Rhino.Inside”.

  • Wrote the following simplified sample code:

’ ----------------------------------------------------------------------------
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

RhinoInside.Resolver.Initialize()

End Sub
’ ----------------------------------------------------------------------------

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Points As Rhino.Collections.Point3dList
Dim Line As Rhino.Geometry.Line
Dim Model As Rhino.FileIO.File3dm

Points = New Rhino.Collections.Point3dList
Points.Add(x:=0R,
y:=0R,
z:=0R)
Points.Add(x:=1.0R,
y:=1.0R,
z:=1.0R)

Line = New Rhino.Geometry.Line(from:=Points(0I),
[to]:=Points(1I))

Model = New Rhino.FileIO.File3dm
Model.Objects.AddLine(line:=Line)

Model.Write(path:=“C:\Temp\Line.dxf”,
version:=5I)

End Sub
’ ----------------------------------------------------------------------------

In “Sub Button1_Click”, the line “Model = New Rhino.FileIO.File3dm” results in exception 0x8007045A.

What went wrong here?

Thanks for your help

I think you should probably use the x64 platform target, and you’re not using that now.

Select your project, right-click and select properties. Then go to “Build” and check the Platform. This should be x64. If not, add this in the Configuration Manager.

Next: Platform Target. This should be set to x64 or AnyCPU. The option “Prefer 32-bit” should be greyed out or unchecked.

1 Like

Hi Menno,

Thanks for your quick response.

  • ‘Platform target’ is x64 for Debug and Release.

  • ‘Prefer 32-bit’ is unchecked and greyed out.

  • Build started: Configuration: ‘Debug x64’

… unfortunately the problem persists.

Hi @Thomas_Irnich,

There is a sample VB.NET console application that uses Rhino Inside. Perhaps you can gleam something from it.

TestMichaelInside.zip (8.1 KB)

– Dale

1 Like

Hello Dale,

Yes, in the test application I could find the crucial hint:

Apparently the following statement was missing:

Using New Rhino.Runtime.InProcess.RhinoCore
End Using

Thank you very much and have a nice evening!

Thomas

1 Like