Version: 1.49.4-beta via NuGet
Unable to load DLL 'libSkiaSharp.dll': Nie mo偶na odnale藕膰 okre艣lonego modu艂u. (Exception from HRESULT: 0x8007007E)
at SkiaSharp.SkiaApi.sk_filewstream_new(String path)
at SkiaSharp.SKFileWStream..ctor(String path)
at SkiaSharpDemo.Window1.SkiaCreatePdf()
Code to reproduce: https://github.com/wieslawsoltes/SkiaSharpDemo
``` C#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using SkiaSharp;
namespace SkiaSharpDemo
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
}
void Button_Click(object sender, RoutedEventArgs e)
{
try
{
SkiaCreatePdf();
}
catch (Exception ex)
{
Debug.Print(ex.Message);
Debug.Print(ex.StackTrace);
}
}
private void SkiaCreatePdf()
{
float width = 800f;
float height = 600f;
using (var stream = new SKFileWStream ("document.pdf"))
{
using (var document = SKDocument.CreatePdf (stream))
{
// the first page
using (var canvas = document.BeginPage (width, height))
{
using (var paint = new SKPaint ())
{
canvas.DrawText ("...PDF...", 10f, 100f, paint);
document.EndPage ();
}
}
// the second page
using (var canvas = document.BeginPage (width, height))
{
using (var paint = new SKPaint ())
{
canvas.DrawText ("...PDF...", 10f, 100f, paint);
document.EndPage ();
}
}
// all done
document.Close ();
}
}
}
}
}
```
I receive a similar error when trying to use SkiaSharp from C# Interactive Window on VS 2015 on Windows 10. .NET Framework 4.6
`
var surface = SKSurface.Create(500, 500, SKColorType.Rgba_8888, SKAlphaType.Premul);
Unable to load DLL 'libskia_windows.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
- SkiaSharp.SkiaApi.sk_surface_new_raster(SkiaSharp.SKImageInfo&, System.IntPtr)
- SkiaSharp.SKSurface.Create(int, int, SkiaSharp.SKColorType, SkiaSharp.SKAlphaType)
`
@wieslawsoltes Is this still an issue with the latest release (v1.53.x)?
Yes, the issue is still present in 1.53.0 release.
@wieslawsoltes, I just want to check, is there a libSkiaSharp.dll in the same directory as SkiaSharp.dll? libSkiaSharp.dll is the native part of the library and must be present.
@mattleibow Yes. You can try my app which uses Skia 1.53.0 https://chocolatey.org/packages/Core2D.Avalonia.Skia
@tdenniston I was just wondering if you have this issue at all. I see from some of your issues that you are using Win7?
@mattleibow I am using Win7. I just tried to reproduce this bug by cloning https://github.com/wieslawsoltes/SkiaSharpDemo and running with both 1.49.4-beta and 1.53, and I was unable to reproduce it. The app built, ran, and produced the PDF correctly when I pressed the button.
@mattleibow The issue is easly reproducible in my tests using https://github.com/wieslawsoltes/SkiaSharpDemo (done on Windows 7 sp1 x64 using VM, Windows 7 sp1 32-bit using VM, and on real laptop running window 7 sp1).
Screenshot using VM (https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/#downloads, IE11 on Win7):

@wieslawsoltes
From a colleague of mine:
It might be the C++ runtime is not installed. I can repro it if I rename c:\windowssystem32\msvcp140.dll to something else. The libSkiaSharp.dll depends on that.
https://support.microsoft.com/en-us/kb/2977003
PS: I am still getting my Win7 VM up
@mattleibow Thanks for tip, installing the Microsoft Visual C++ 2015 Redistributable https://www.microsoft.com/en-us/download/details.aspx?id=52982 solved the issue.
Would be nice if this information would be provided in README or in wiki page.
Other solution would be to link statically the .dll. for windows. The size would increase a little, but would not cause such problems in future.
+1 to the idea of statically linking the runtime to libSkiaSharp.dll (or providing the option, since of course it is not always the right choice). It seems odd to me to have the advantage of deploying a managed application but then having to deal with the MS C++ runtime dependency (and versioning) just as for deploying regular C++ applications.
@tdenniston @wieslawsoltes Typically one would create an installer or the ClickOnce deployment and include the VC++ Runtime as part of the install package. But, I am glad that this is resolved and I will definitely have a look at the other options in the other issue. Thanks @tdenniston for confirming this!
In case anyone encounters a similar problem, it's worth noting that SkiaSharp now requires Microsoft Visual C++ 2017 Redistributable (instead of 2015) which can be found at https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads.
Most helpful comment
In case anyone encounters a similar problem, it's worth noting that SkiaSharp now requires Microsoft Visual C++ 2017 Redistributable (instead of 2015) which can be found at https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads.