SkiaSharp
SkiaSharp copied to clipboard
[QUESTION] libSkiaSharp throwing exception in Windows Server 2019 Data Center
I have an console application which creates PDF Files from ZPL(Printer) data. I am using an open source for that to create pdf files. I have to use SkiaSharp as a dependency package, which is working in my local machine-Windows 10.
After deploying the console application to Windows Server 2019 (It is in Azure Cloud), It's throwing initialization error, I have used both x86 and x64 files'
When I use x86 file, I am getting DLL Not found Exception: Unhandled Exception: System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libSkiaSharp': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at SkiaSharp.SkiaApi.sk_colortype_get_default_8888() at SkiaSharp.SKImageInfo..cctor() --- End of inner exception stack trace --- at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, Boolean isOpaque) at #=z891Mmvub7w2Dv_HuwbsDtcRtIASLwSdx8kKeh9A=.#=z_WhVP_E=() at Neodynamic.SDK.ZPLPrinter.ZPLPrinter.ProcessCommands(String zplCommands, Encoding textEncoding, Boolean traceRenderedElements) at Neodynamic.SDK.ZPLPrinter.ZPLPrinter.ProcessCommands(String zplCommands, Boolean traceRenderedElements)
When I use x64 file, I am getting BadImageFormatException: Unhandled Exception: System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at SkiaSharp.SkiaApi.sk_colortype_get_default_8888() at SkiaSharp.SKImageInfo..cctor() --- End of inner exception stack trace --- at SkiaSharp.SKBitmap..ctor(Int32 width, Int32 height, Boolean isOpaque) at #=z891Mmvub7w2Dv_HuwbsDtcRtIASLwSdx8kKeh9A=.#=z_WhVP_E=() at Neodynamic.SDK.ZPLPrinter.ZPLPrinter.ProcessCommands(String zplCommands, Encoding textEncoding, Boolean traceRenderedElements) at Neodynamic.SDK.ZPLPrinter.ZPLPrinter.ProcessCommands(String zplCommands, Boolean traceRenderedElements)
I am using SkiaSharp.dll version 1.60.0 version. Any help is appreciated
Try installing Visual C++ Redistributable for Visual Studio 2015