invalid access to memory location when using Magick.Net

0

I have a console app which is a native host to a chrome/firefox extension, this console app is a 32-bit app and using Magick.Net-Q8-x86 nuget package.

The console app takes an image from passport reader, compresses it using ImageOptimizer and sends it back to chrome/firefox.

when I launch firefox, click the button that will launch the native host, It crashes and I see this in firefox browser console :

Unhandled Exception: System.TypeInitializationException: The type initializer for 'NativeMagickSettings' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'Magick.NET-Q8-x86.Native.dll': Invalid access to memory location. (Exception from HRESULT: 0x800703E6) stderr output from native app org.nas.mtnocr: at ImageMagick.Environment.NativeMethods.X86.Environment_Initialize() stderr output from native app org.nas.mtnocr: at ImageMagick.Environment.Initialize() stderr output from native app org.nas.mtnocr: at ImageMagick.MagickSettings.NativeMagickSettings..cctor() stderr output from native app org.nas.mtnocr: --- End of inner exception stack trace --- stderr output from native app org.nas.mtnocr: at ImageMagick.MagickSettings.NativeMagickSettings..ctor() stderr output from native app org.nas.mtnocr: at ImageMagick.MagickSettings..ctor() stderr output from native app org.nas.mtnocr: at ImageMagick.MagickImage..ctor() stderr output from native app org.nas.mtnocr: at ImageMagick.MagickImageInfo.Read(Stream stream) stderr output from native app org.nas.mtnocr: at ImageMagick.ImageOptimizer.GetOptimizer(Stream stream) stderr output from native app org.nas.mtnocr: at ImageMagick.ImageOptimizer.Compress(Stream stream) stderr output from native app org.nas.mtnocr: at MtnOcr.Program.compressAndRotate(Byte[] imdata) stderr output from native app org.nas.mtnocr: at MtnOcr.Program.Main(String[] args)

I tried disabling DEP using this command:

bcdedit.exe /set {current} nx AlwaysOff

and rebooting, same error.

I had UAC completly disabled using registery in this post so I enabled it, same error with both UAC disabled and enabled.

I have Magick.Net-Q8-x86.Native.dll on the console app path and when I remove it I get different error that specified module was not found.

The odd thing is that this 32-bit console app works correctly on a 64-bit OS but not on 32-bit OS.

my OS is windows 7 SP1 32 bit.

c#
asked on Stack Overflow Apr 10, 2018 by niceman

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0