Skip to content

[Solved] ScottPlot 5 Linux TypeFace issues due to missing DLL #3357

@swharden

Description

@swharden

The type initializer for 'SkiaSharp.SKTypeface' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.

I got this message when using ScottPlot 5 in an Azure Functions app running on a Linux server. Here's the full message, and it's a mess:

Result: Failure Exception: System.TypeInitializationException: The type initializer for 'ScottPlot.Fonts' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SkiaSharp.SKTypeface' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libSkiaSharp.so: cannot open shared object file: No such file or directory /home/site/wwwroot/libSkiaSharp.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/liblibSkiaSharp.so: cannot open shared object file: No such file or directory /home/site/wwwroot/liblibSkiaSharp.so: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libSkiaSharp: cannot open shared object file: No such file or directory /home/site/wwwroot/libSkiaSharp: cannot open shared object file: No such file or directory /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/liblibSkiaSharp: cannot open shared object file: No such file or directory /home/site/wwwroot/liblibSkiaSharp: cannot open shared object file: No such file or directory at SkiaSharp.SkiaApi.sk_typeface_ref_default() at SkiaSharp.SKTypeface..cctor() --- End of inner exception stack trace --- at SkiaSharp.SKTypeface.get_Default() at ScottPlot.Fonts.InstalledSansFont() at ScottPlot.Fonts..cctor() --- End of inner exception stack trace --- at ScottPlot.Fonts.get_Default() at ScottPlot.Label..ctor() at ScottPlot.Panels.TitlePanel..ctor() at ScottPlot.AxisManager..ctor(Plot plot) at ScottPlot.Plot..ctor() at ScottPlotStats.Plot.DownloadCount(CountDatabase db, Int32 width, Int32 height) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats/Plot.cs:line 20 at ScottPlotStats.Functions.UpdateNugetStatsFunction.CreatePlots(CountDatabase db, BlobContainerClient containerClient) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats.Functions/UpdateNugetStatsFunction.cs:line 80 at ScottPlotStats.Functions.UpdateNugetStatsFunction.Run(TimerInfo myTimer) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats.Functions/UpdateNugetStatsFunction.cs:line 27 at lambda_method1(Closure, UpdateNugetStatsFunction, Object[]) at Microsoft.Azure.Functions.Worker.Invocation.VoidMethodInvoker'2.InvokeAsync(TReflected instance, Object[] arguments) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\VoidMethodInvoker.cs:line 22 at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker'2.InvokeAsync(Object instance, Object[] arguments) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 31 at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88 Stack: at ScottPlot.Fonts.get_Default() at ScottPlot.Label..ctor() at ScottPlot.Panels.TitlePanel..ctor() at ScottPlot.AxisManager..ctor(Plot plot) at ScottPlot.Plot..ctor() at ScottPlotStats.Plot.DownloadCount(CountDatabase db, Int32 width, Int32 height) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats/Plot.cs:line 20 at ScottPlotStats.Functions.UpdateNugetStatsFunction.CreatePlots(CountDatabase db, BlobContainerClient containerClient) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats.Functions/UpdateNugetStatsFunction.cs:line 80 at ScottPlotStats.Functions.UpdateNugetStatsFunction.Run(TimerInfo myTimer) in /home/runner/work/ScottPlotStats/ScottPlotStats/src/ScottPlotStats.Functions/UpdateNugetStatsFunction.cs:line 27 at lambda_method1(Closure, UpdateNugetStatsFunction, Object[]) at Microsoft.Azure.Functions.Worker.Invocation.VoidMethodInvoker'2.InvokeAsync(TReflected instance, Object[] arguments) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\VoidMethodInvoker.cs:line 22 at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionInvoker'2.InvokeAsync(Object instance, Object[] arguments) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionInvoker.cs:line 31 at Microsoft.Azure.Functions.Worker.Invocation.DefaultFunctionExecutor.ExecuteAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\Invocation\DefaultFunctionExecutor.cs:line 45 at Microsoft.Azure.Functions.Worker.OutputBindings.OutputBindingsMiddleware.Invoke(FunctionContext context, FunctionExecutionDelegate next) in D:\a_work\1\s\src\DotNetWorker.Core\OutputBindings\OutputBindingsMiddleware.cs:line 13 at Microsoft.Azure.Functions.Worker.FunctionsApplication.InvokeFunctionAsync(FunctionContext context) in D:\a_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 77 at Microsoft.Azure.Functions.Worker.Handlers.InvocationHandler.InvokeAsync(InvocationRequest request) in D:\a_work\1\s\src\DotNetWorker.Grpc\Handlers\InvocationHandler.cs:line 88

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions