After upgrading .net core from 3.1 to 5 I'm getting error in loading dll: GLIBC_2.29 not found

Animesh Singh 1 Reputation point
2021-09-30T06:11:33.84+00:00

I have a native application written in c++ and complied into the .so library through docker which I'm using in the .net core 3 projects and importing .so library as DLL using DllImport InterOpServices. I'm utilizing azure DevOps to host and deploy the application where my shared library .so works well with .net core 3 and aspnet:3.1-focal/sdk:3-1-focal docker images but as part of upgrading the framework from .net core 3 to .net core 5, I'm getting a runtime error while utilizing the shared library (.so library). Below is the error.

Error during using xxx library, Inner ExceptionSystem.DllNotFoundException: Unable to load shared library 'xxxx/libwoundmeasurementinterface_be.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by xxxx/libwoundmeasurementinterface_be.so)

I checked GLIBC_2.29 is not supported anymore in Ubuntu versions, I'm suspecting it might be something with docker images of aspnet:5-0/sdk:5.0 versions.

The way I'm loading shared library in .net project

[DllImport("xxxx/libwoundmeasurementinterface_be.so", EntryPoint = "NameOfTheMethod", CallingConvention = CallingConvention.StdCall, SetLastError = true)]

In my c++ native code nowhere we have nowhere hardcoded the version of GLIBC_2.29.

How to check what libraries are installed in docker images? Is upgrading the docker images to 5.x version is causing issue ?

What could be a possible solution here?

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Other
Developer technologies | C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.