Unable to load shared library 'libHarfBuzzSharp' or one of its dependencies Error when running on linux after upgrading to .NET 6
Asked Answered
S

2

5

Posting this here in case it helps someone else.

We use GemBox to build Excel reports and PDF's and we run our code on Linux.

We've been upgrading our projects to .NET 6 and have just run into this error.

Unable to load shared library 'libHarfBuzzSharp' or one of its dependencies...

I looked into GemBox's release notes and found they have made steps to move away from System.Drawing as Microsoft has dropped Linux support for this.

Gembox Announcement

Sheehan answered 5/9, 2022 at 9:57 Comment(0)
S
14

Interestingly, having GemBox Nuget up-to-date did not install these dependencies, so we installed HarfBuzzSharp 2.8.x.x and ran our code. We still got the same issue. We then had to install HarfBuzzSharp.NativeAssets.Linux 2.8.x.x.

Once we manually updated these dependencies, our code worked again.

Hope this helps someone else.

P.s. this is also likely the case for SkiaSharp

Sheehan answered 5/9, 2022 at 9:57 Comment(1)
Yes, both HarfBuzzSharp.NativeAssets.Linux and SkiaSharp.NativeAssets.Linux are required on Linux. Please check the Linux / macOS and Docker examples.Fogdog
B
0

Useful information. both HarfBuzzSharp.NativeAssets.Linux and SkiaSharp.NativeAssets.Linux should be installed by nuget.

System.DllNotFoundException: Unable to load shared library 'libHarfBuzzSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibHarfBuzzSharp: cannot open shared object file: No such file or directory

Byandby answered 28/4, 2023 at 5:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.