-
-
Notifications
You must be signed in to change notification settings - Fork 432
Open
Description
Magick.NET version
Magick.NET-Q8-AnyCPU 14.6.0
Environment (Operating system, version and so on)
Windows 10 x64 22H2 + Android Emulator (default virtual device - Pixel 7 API 35) + VS 2022 17.13.5
Description
I've created a netstandard20 class library and added Magick.NET-Q8-AnyCPU 14.6.0
nuget reference to it. In it I simply open image via:
using var image = new MagickImage(new FileInfo(imagePath));
And I've created MAUI application from a template (.NET 8.0 framework), referenced my class library and called that method. And i got an exception:
{System.TypeInitializationException: The type initializer for 'NativeMagickSettings' threw an exception.
---> System.DllNotFoundException: Magick.Native-Q8-x64.dll
at ImageMagick.Environment.NativeMethods.Environment_Initialize() in /_/src/Magick.NET/Generated/Magick.NET.SourceGenerator/ImageMagick.SourceGenerator.NativeInteropGenerator/Environment.g.cs:line 56
at ImageMagick.Environment.NativeEnvironment.Initialize() in /_/src/Magick.NET/Generated/Magick.NET.SourceGenerator/ImageMagick.SourceGenerator.NativeInteropGenerator/Environment.g.cs:line 90
at ImageMagick.Environment.Initialize() in /_/src/Magick.NET/Helpers/Environment.cs:line 21
at ImageMagick.MagickSettings.NativeMagickSettings..cctor() in /_/src/Magick.NET/Generated/Magick.NET.SourceGenerator/ImageMagick.SourceGenerator.NativeInteropGenerator/MagickSettings.g.cs:line 737
--- End of inner exception stack trace ---
at ImageMagick.MagickSettings..ctor() in /_/src/Magick.NET/Settings/MagickSettings.cs:line 33
at ImageMagick.MagickImage..ctor() in /_/src/Magick.NET/MagickImage.cs:line 43
at ImageMagick.MagickImage..ctor(FileInfo file) in /_/src/Magick.NET/MagickImage.cs:line 117
at CrossPlatformUtils.Graphics.ResizeImage(String sourcePath, UInt32 resizedWidth, UInt32 resizedHeight) in D:\projects\Resto.CrossPlatformUtils\Graphics.cs:line 13}
Running same MAUI application on Windows (net8.0-windows10.0.19041.0 target) is ok. Looks like it's Android specific.
Steps to Reproduce
- Create a netstandard20 class library
- Add
Magick.NET-Q8-AnyCPU 14.6.0
nuget reference - Create Graphics.cs with Graphics class and TestMagick function that calls
using var image = new MagickImage(new FileInfo(imagePath));
- Create MAUI application (chose .NET8.0 framework)
- Refefence the class library in the MAUI application
- Add a call of Graphics.TestMagick function
- Start debugging on Android Emulator (default virtual device - Pixel 7 API 35)
Images
Metadata
Metadata
Assignees
Labels
No labels