rhino3dm: DllNotFoundException for 'librhino3dm_native' on linux for versions above 7.6.0 for .NET

System.DllNotFoundException: Unable to load shared library 'librhino3dm_native' or one of its dependencies.

This error occurs when running on linux-x64 machines with .NET6, for any versions higher than 7.6.0.

I would really like to upgrade, since there are newly added apis i would like to use, such as Curve.JoinCurves, and would like to move to .NET7.

This issue has been around for a while, but there seems to be no updates on it.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

I think Azure App Service runs on Debian. I’ve not tested rhino3dm on Azure App Platform / Debian yet. I’ll open this up again while I do some testing. Thanks for reporting.

I just published a rhino3dm8.0.0-beta.1 on nuget: https://www.nuget.org/packages/Rhino3dm/8.0.0-beta.1 with the fixes discussed here.

@tkahng I’ve tested two templates:

  • Lambda Empty Function - .NET 6.0
  • Lambda Empty Function (.NET 7 Container Image) - .NET 7.0

Both running the same code:

    public string FunctionHandler(string input, ILambdaContext context)
    {
        var file3dm = Rhino.FileIO.File3dm.Read("RectifiedArchimedeanSolids8.3dm");        
        return "Number of objects in file " +  file3dm.Objects.Count.ToString();
    }

The csproj file is like this:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    <AWSProjectType>Lambda</AWSProjectType>
    <!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <!-- Generate ready to run images during publishing to improve cold start time. -->
    <PublishReadyToRun>true</PublishReadyToRun>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.1" />
  </ItemGroup>
  <ItemGroup>
    <Reference Include="Rhino3dm">
      <HintPath>Rhino3dm.dll</HintPath>
    </Reference>
  </ItemGroup>
  <Target Name="CopyCustomContent" AfterTargets="AfterBuild">
    <Copy SourceFiles="RectifiedArchimedeanSolids8.3dm" DestinationFolder="$(OutDir)" />
    <Copy SourceFiles="librhino3dm_native.so" DestinationFolder="$(OutDir)" />
  </Target>
  <Target Name="CopyCustomContentOnPublish" AfterTargets="Publish">
    <Copy SourceFiles="RectifiedArchimedeanSolids8.3dm" DestinationFolder="$(PublishDir)" />
    <Copy SourceFiles="librhino3dm_native.so" DestinationFolder="$(PublishDir)" />
  </Target>
</Project>

This is mostly because I am testing the library as I build it. Normally you’d have rhino3dm as a Package Reference.

And the files: image

I just was able to test this on an aws ec2 linux-x64 instance. I provisioned, connected, installed git, dotnet 7 runtime and sdk, pulled the developer samples onto the machine and ran dotnet run. As you’ve already confirmed, it works.

Next week I will check on aws lambdas.

okay wait i missed the GLIBC_2.27' not found . let me take a look