-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load DLL 'libSkiaSharp' when referenced in class library targetting netstandard1.3 #2728
Comments
Try updating netframework to latest netframework or dotnet8 so you can use netstandard2.0 at least. |
I tried updating my sample project to .NET Framework 4.8 and had no issues, SkiaSharp worked out of the box without having to add So it is an issue specific for .NET Framework 4.6 / .NETStandard 1.3. |
.NET Framework 4.6 is out of support so there is no expectation that this should work or not work. A search for netstandard in the repo indicates that netstandard1.3 has been removed with netstandard2.0 and netstandard2.1 and net462 as current targets, which makes sense. |
I expect those references would be removed when the current prerelease gets released. Why would this matter to you? You said you updated your project to netframework 4.8 and there was no problem. |
Hi folks, looking at this issue I think the nuget UI and readme may not be the greatest source of how this all works. The meaning of support for .NET Standard 1.3 really just refers to the API level. There is no real ".NET Standard" app. So you can't "run" it. This just means that if you want to build a .NET Standard dll with SkiaSharp, you can do so. The other part is the .NET Framework, and that is just supported from 4.6.2 since that is the earliest version that supports .NET Standard 2.0. I agree this is a bit confusing as you have to know that .NET Standard is not really meant to be used in the way you would expect. I need to see why I do not copy the native dlls for plain .NET Standard. I am sure there was a reason. If you were to build a net8.0 class library I think it gets copied. So, it may have been that everyone using .NET Standard just used it as a library and had some form of app. |
I can relate. The problem occurs on the line:
Message: Installed libs via nuget: I use .NET 7, Class Library project, AnyCPU (i tried x64 too) The libSkiaSharp.dll exisits in all subfolders of Weird behavior: Any ideas? |
I encountered a similiar issue in a WinForm (.NET Framework 4.8) project that use ScottPlot: (5.0.44). My situation is:
I just save .csproj outside VS2022 without changing anything and force VS2022 reload project and the files are copy to as it excepted. |
Description
SkiaSharp beginner here, using VS2019. I created an ASP.NET WebForms application, targetting .NET Framework 4.6 (=.NETStandard 1.3), and installed SkiaSharp v2.88.7 NuGet package in a class library referenced by the WebForms application, compiling as AnyCPU. On build the LibSkiaSharp.dll is not deployed to any bin folder and on runtime I get the infamous error:
Unable to load DLL 'libSkiaSharp': The specified module could not be found.
I added
to all PropertyGroups of both the class library and Webforms application *.csproj files, but it makes no difference. I'm out of ideas... From what I could research:
I confirmed the same issue happens on version 2.80.0.
SkiaSharp v1.68.3 works fine and I do get libSkiaSharp.dll deployed in the bin folder, so for now I will continue using that version.
Code
I created a sample project to reproduce the issue and uploaded it to the following GitHub repository:
https://github.com/lbras/SkiaSharpTestWebFormsNETFramework46
Expected Behavior
LibSkiaSharp.dll should be copied to the application bin folder
Actual Behavior
LibSkiaSharp.dll is not deployed with the application, resulting in runtime errors
Version of SkiaSharp
2.88.3 (Current)
Last Known Good Version of SkiaSharp
1.x (Obsolete)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 10
Devices
No response
Relevant Screenshots
No response
Relevant Log Output
Code of Conduct
The text was updated successfully, but these errors were encountered: