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;
}
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;
}