question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Magick.NET 9.0.0 - The type initializer for 'NativeResourceLimits' threw an exception.

See original GitHub issue

Description

Dear all, I was testing the new release of Magick.Net and I found out an exception limitating the memory of the process.

Error: The type initializer for 'NativeResourceLimits' threw an exception.

Stack Trace: at ImageMagick.ResourceLimits.NativeResourceLimits.LimitMemory(Double percentage) at ImageMagick.ResourceLimits.LimitMemory(Percentage percentage) in /_/src/Magick.NET/ResourceLimits.cs:line 95 at Libraries.Managers.Graphics.ImageManager..ctor(Process process) at Libraries.Managers.Graphics.GraphicsManager.Elabora_SincronizzazioneGrafiche_GestisciGrafica(DataTosGraficheServices dataTosGraficheServices) at Libraries.Managers.Graphics.GraphicsManager.Elabora_SincronizzazioneGrafiche()

Inner Exception: System.DllNotFoundException: Unable to load DLL 'Magick.Native-Q8-x64.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at ImageMagick.Environment.NativeMethods.X64.Environment_Initialize() at ImageMagick.Environment.Initialize() in /_/src/Magick.NET/Helpers/Environment.cs:line 22 at ImageMagick.ResourceLimits.NativeResourceLimits..cctor() in /_/src/Magick.NET/Native/ResourceLimits.cs:line 137

Steps to Reproduce

Call the method ResourceLimits.LimitMemory(percentage)

image

System Configuration

  • Magick.NET version: Magick.NET.Core + Magick.NET-Q8-AnyCPU
  • Environment (Operating system, version and so on): Windows 10.0.17763
  • Additional information: .NET Framework 4.7.2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Feb 7, 2022

Thanks for the repository. I think I found a proper fix for it now. Can you try it again with release 9.1.1?

0reactions
MattiaCamponescocommented, Feb 8, 2022

Yes, I confirm, v9.1.1 works. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

MagickNet type initializer throws exception
I have created an ASP.NET web application and added references to the above 2 dlls. The following code blows up on the second...
Read more >
c# - The type initializer for 'ImageMagick.Types' threw an ...
I have just installed a Magick.net from the nuget and codeplex. I just want to write a sample application for compressing an image...
Read more >
Bug when trying to use Magick.NET in Unity 2022.3.4f1
Rethrow as TypeInitializationException: The type initializer for 'NativeMagickSettings' threw an exception. ImageMagick.
Read more >
New packaging requirements for plugins starting with PDN ...
TypeInitializationException : The type initializer for 'NativeMagickSettings' threw an exception. ---> System.DllNotFoundException: Unable to ...
Read more >
Issue with Image Magick - Access denied
TypeInitializationException : The type initializer for 'NativeMagickSettings' threw an exception. ---> System.DllNotFoundException: Unable to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found