Hi. I created an x64 console application in VS2015 to try out the SkiaSharp nugget package. No problem.
But if I create a unit test project, the simplest of tests using SkiaSharp causes an exception. The message shown in the test result pane is
Test Outcome: Failed
Test Duration: 0:00:00.0388023
Result StackTrace:
at SkiaSharp.SkiaApi.sk_filestream_new(String path)
at SkiaSharp.SKFileStream..ctor(String path)
at SkiaSharp.SKBitmap.Decode(String filename)
at BCA.Imaging.ImageHelper.TestSaveScaledImage() in C:\Users\Mike\Documents\Visual Studio 2015\Projects\ImagingLibrariesEvaluation\Imaging\ImageHelper.cs:line 15
at ImagingUnitTest.ImagingUnitTests.TestSkiaConcurrency() in C:\Users\Mike\Documents\Visual Studio 2015\Projects\ImagingLibrariesEvaluation\ImagingUnitTest\ImagingUnitTests.cs:line 33
Result Message:
Test method ImagingUnitTest.ImagingUnitTests.TestSkiaConcurrency threw exception:
System.DllNotFoundException: Unable to load DLL 'libSkiaSharp.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
although the output of the Tests window is slightly different:
------ Run test started ------
System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at SkiaSharp.SKObject.Dispose(Boolean disposing)
at SkiaSharp.SKFileStream.Dispose(Boolean disposing)
at SkiaSharp.SKNativeObject.Finalize()
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at SkiaSharp.SKObject.Dispose(Boolean disposing)
at SkiaSharp.SKFileStream.Dispose(Boolean disposing)
at SkiaSharp.SKNativeObject.Finalize()
========== Run test finished: 1 run (0:00:00.2200161) ==========
Do you know of any workaround? I really need to get a unit test project up and running to convince my manager (and demonstrably so) that SkiaSharp is going to be reliable in a multithreaded environment, for example ASP.Net.
Thanks