I was looking into Rhino.Inside and came across these handy examples on McNeel’s Github Repo. The examples work well without any issues.
I tried recreating the examples from scratch and ran into some errors. I created a new Visual Studio c# console application. I installed the Rhino.Inside nuget package. I noticed that in the References list, there were several files that were installed. Whereas in the provided example there was only one reference installed. In the image below on the left are the references that were installed when I tried to recreate the projects from scratch. On the right is a snapshot of McNeel’s example.
I wrote the code exactly as in the example listed above and got this error:
Unable to load DLL 'RhinoLibrary': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
I looked deeper at the .csproj files and noticed there was a difference in my file vs the provide example file. The provide example file has a simple Item reference
<ItemGroup>
<PackageReference Include="Rhino.Inside">
<Version>7.0.0</Version>
</PackageReference>
</ItemGroup>
In my .csproj file the Item references looked like this:
<ItemGroup>
<Reference Include="Eto, Version=2.5.0.0, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoCommon.7.0.20314.3001\lib\net45\Eto.dll</HintPath>
</Reference>
<Reference Include="Eto.Wpf, Version=2.5.0.0, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoWindows.7.0.20314.3001\lib\net45\Eto.Wpf.dll</HintPath>
</Reference>
<Reference Include="GH_IO, Version=7.0.20314.3000, Culture=neutral, PublicKeyToken=6a29997d2e6b4f97, processorArchitecture=MSIL">
<HintPath>..\packages\Grasshopper.7.0.20314.3001\lib\net45\GH_IO.dll</HintPath>
</Reference>
<Reference Include="Grasshopper, Version=7.0.20314.3000, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803, processorArchitecture=MSIL">
<HintPath>..\packages\Grasshopper.7.0.20314.3001\lib\net45\Grasshopper.dll</HintPath>
</Reference>
<Reference Include="Rhino.UI, Version=7.0.20314.3000, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoCommon.7.0.20314.3001\lib\net45\Rhino.UI.dll</HintPath>
</Reference>
<Reference Include="RhinoCommon, Version=7.0.20314.3000, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoCommon.7.0.20314.3001\lib\net45\RhinoCommon.dll</HintPath>
</Reference>
<Reference Include="RhinoInside, Version=7.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\Rhino.Inside.7.0.0\lib\net48\RhinoInside.dll</HintPath>
</Reference>
<Reference Include="RhinoWindows, Version=7.0.0.0, Culture=neutral, PublicKeyToken=552281e97c755530, processorArchitecture=MSIL">
<HintPath>..\packages\RhinoWindows.7.0.20314.3001\lib\net45\RhinoWindows.dll</HintPath>
</Reference>
</ItemGroup>
Once I edited my .csproj file to match McNeel’s example, everything worked fine (so far). Can somebody explain what is happening?
Thanks.