Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

System.DllNotFoundException #494

Open
shashanksivakoti opened this issue Nov 21, 2022 · 0 comments
Open

System.DllNotFoundException #494

shashanksivakoti opened this issue Nov 21, 2022 · 0 comments

Comments

@shashanksivakoti
Copy link

shashanksivakoti commented Nov 21, 2022

Hi Team,

I am facing one issue like System.DllNotFoundException after deploying my changes on Dev Environment using Azure pipeline,

Exception The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library liblibSkiaSharp: No such file or directory

I am using this for .Net Standard 2.1 project file.

Code:
using System.IO;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Skia;

private string DrawLegendWithLine(String stroke, String strokeWidth )
{
string imageBase64 = "";
// Create a bitmap in memory and draw on its Canvas
SkiaBitmapExportContext bmp = new SkiaBitmapExportContext(100, 50, 1.0f);
ICanvas canvas = bmp.Canvas;
canvas.StrokeColor = Color.FromRgba(stroke);
canvas.StrokeSize = 10;
canvas.DrawLine(100, 0, 0, 0);
using (var ms = new MemoryStream())
{
bmp.WriteToStream(ms);
imageBase64 = Convert.ToBase64String(ms.GetBuffer(), 0, checked((int)ms.Length));
}
return imageBase64;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant