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.

The type initializer for 'X64' threw an exception

See original GitHub issue

Trying to modify existing .NET code by adding few lines to change the size, modify image. tested on local machine without any issues, but on server getting error, Please help ASAP.

Really appreciated any help.

in bin folder i have:

gsdll32 Magick.NET-Q8-AnyCPU Magick.NET.Web-Q8-AnyCPU

New Code:

 ' VALIDATE AND MODIFY IMAGE ****
                Using images As New MagickImageCollection()
                    ' Add all the pages of the pdf file to the collection
                    Dim image As New MagickImage(ConvertedImage)

                    If image.Width > "850" Then
                        Dim sGeometry As New MagickGeometry()

                        With sGeometry
                            .Width = "1150"
                            .Height = "900"
                            .IgnoreAspectRatio = True
                        End With

                        image.Scale(sGeometry)
                        image.Write(ConvertedImage)
                    End If
                End Using
' VALIDATE AND MODIFY IMAGE 

at ImageMagick.MagickSettings.NativeMethods.X64.MagickSettings_Create() at ImageMagick.MagickSettings.NativeMagickSettings…ctor() at ImageMagick.MagickSettings…ctor() at ImageMagick.MagickImage…ctor() at nomination.loadfileHandler.convert_pdf_to_image_nominee(String fn, String NomineeGEID)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dlemstracommented, Jul 13, 2018

It is possible that your application has no access to the temporary directory @blackn1ght, see: https://github.com/dlemstra/Magick.NET/tree/master/Documentation#anycpu

0reactions
vbpAlexcommented, Jul 30, 2018

we still getting exception, but decide just to handle it locally since looks like ddl does what it suppose to do just throw error at the end.

You may close the issue and thanks for support.

Thanks Alex.

On Sun, Jul 29, 2018 at 11:11 AM, Dirk Lemstra notifications@github.com wrote:

@vbpAlex https://github.com/vbpAlex or @blackn1ght https://github.com/blackn1ght Can I close this issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dlemstra/Magick.NET/issues/252#issuecomment-408684306, or mute the thread https://github.com/notifications/unsubscribe-auth/AE1NQuSTuygaf7fVknMbun-M1WoO8Megks5uLdC7gaJpZM4VLuqJ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

The type initializer for 'X64' threw an exception. #874
The application is running on x64. I have tried adding 64 and anycpu dlls for magick.net. can anyone please help me? I am...
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 >
"The Type initializer....threw an exception" error when ...
When logging into an Autodesk Vault you receive the error message: "The Type Initializer for 'Autodesk.Connectivity.WebServices.WSE.
Read more >
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 >
Newer builds not working at all
NET-Q16-OpenMP-x64: The type initializer for 'NativeMagickSettings' threw an exception. I've uninstalled and reinstalled and tried to repair but it all ...
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