Error: The type initializer for 'NativeMagickImageCollection' threw an exception.
See original GitHub issuePrerequisites
- I have written a descriptive issue title
- I have verified that I am using the latest version of Magick.NET
- I have searched open and closed issues to ensure it has not already been reported
Description
With the last 2 versions of Magick.NET I am getting the error:
Error: The type initializer for 'NativeMagickImageCollection' threw an exception.
Steps to Reproduce
Working with an MagickImageCollection as such:
// create a collection of images in order to support multi-page.
using (MagickImageCollection pages = new MagickImageCollection())
{
...
}
This does not happen on release 7.10.2.
- Magick.NET version: .7.11.1 and 7.11.0.
- Environment (Operating system, version and so on): This has happened on Windows 10 Build 1809, and Windows 7.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
MagickNet type initializer throws exception
The error is "The type initializer for 'ImageMagick.MagickImage' threw an exception." it does not matter if i insert an image file path in...
Read more >c# - Errors After Obfuscar Obfuscation
I've used Obfuscar on my C# application, but the obfuscated version throws an exception where the normal version doesn't. I'm trying to figure ......
Read more >magick Issue Tracker Rss Feed
System.TypeInitializationException: The type initializer for 'X64' threw an exception. ---> System.UnauthorizedAccessException: Access to the path 'C:\Windows\ ...
Read more >Error Experienced when Publishing - E-Learning Heroes
<Message>The type initializer for 'NativeMagickImageCollection' threw an exception.</Message> <StackTrace> at new ImageMagick.
Read more >[Solved] The type initializer for '' threw an exception
TypeInitializationException ". This error is raised due to Static constructor . Actually in my case i am accessing some value from the App.config ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This always happens with the AnyCPU version of Magick.NET. You can control the location of the folder with
MagickAnyCPU.CacheDirectory
. And you could aldo whitelist the dll, it is signed with a code signing certificate.I am getting this error only when I deploy the project it works fine from the dev project in visual studio