Failed to load file or assembly "Magick.NET-x64" in mvc application

I am using the Magick.net library in the mvc3 web application and these are the steps I took

My project targets AnyCPU, and my computer is 64 bit
Add a link to the Magick.NET-x64.dll project in the project. Installed Visual C ++ Redistributable for Visual Studio 2012 Update 4 from here http://www.microsoft.com/en-us/download/details.aspx?id=30679 Installed Ghostscript 9.14 for Windows (64 bit) on the machine Added

<add assembly="Magick.NET-x64, Version=7.0.0.0002, Culture=neutral, PublicKeyToken=2004825badfa91ec" /> 

in web.config file

The project was successfully restored [and all the DLLs are also in the bin folder], but during operation I get exceptions

Failed to load file or assembly "Magick.NET-x64" or one of its dependencies. An attempt was made to download a program with the wrong format.

Description: An unhandled exception occurred during the execution of the current web request. Check the stack trace for more information> about the error and where it occurred in the code.

Exception Details: System.BadImageFormatException: Failed to load file or assembly "Magick.NET-x64" or one of its dependencies. An attempt was made to download a program with the wrong format.

Source Error:
An unhandled exception was thrown during the execution of the current web request. The information on the origin and location of the exception> can be identified using the exception stack trace below.

Figure boot download . The following information may be useful in determining why the assembly "Magick.NET-x64" cannot be loaded.

 === Pre-bind state information === LOG: DisplayName = Magick.NET-x64 (Partial) WRN: Partial binding information was supplied for an assembly: WRN: Assembly Name: Magick.NET-x64 | Domain ID: 6 WRN: A partial bind occurs when only part of the assembly display name is provided. WRN: This might result in the binder loading an incorrect assembly. WRN: It is recommended to provide a fully specified textual identity for the assembly, WRN: that consists of the simple name, version, culture, and public key token. WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue. LOG: Appbase = file:///C:/Fagbokforlaget/SourceCodes/fbf_internal/picsilo/Source/ImageTagger/ LOG: Initial PrivatePath = C:\Fagbokforlaget\SourceCodes\fbf_internal\picsilo\Source\ImageTagger\bin Calling assembly : (Unknown). LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Fagbokforlaget\SourceCodes\fbf_internal\picsilo\Source\ImageTagger\web.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///C:/Users/jibinmathew/AppData/Local/Temp/Temporary ASP.NET Files/root/a5b5e44f/dc1c4c69/Magick.NET-x64.DLL. LOG: Attempting download of new URL file:///C:/Users/jibinmathew/AppData/Local/Temp/Temporary ASP.NET Files/root/a5b5e44f/dc1c4c69/Magick.NET-x64/Magick.NET-x64.DLL. LOG: Attempting download of new URL file:///C:/Fagbokforlaget/SourceCodes/fbf_internal/picsilo/Source/ImageTagger/bin/Magick.NET-x64.DLL. ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated. 
+8
c # asp.net-mvc-3
source share
3 answers

Revision in a post posted by @dlemstra has the easiest solution I have found for this:

In VS2013 / 2015, go to Tools β†’ Options β†’ Projects and Solutions β†’ Web Projects and select β€œUse the 64-bit version of IIS Express for websites and projects”.

Use 64-bit IIS Express

+9
source share

There seems to be a problem running Magick.NET 64-bit on Visual Studio 2013 IIS Express. You need to set the registry key according to the following answer High quality JPEG compression using C # ". You can set this flag or switch to the AnyCPU version of Magick.NET.

+7
source share

Make sure the C ++ redistributable package is also installed.

https://magick.codeplex.com/documentation

Make sure you install on Visual C ++ Redistributable for Visual Studio

 .NET 4.0: Visual C++ Redistributable for Visual Studio 2015 (x64 or x86) .NET 2.0: Visual C++ Redistributable for Visual Studio 2008 (x64 or x86). 
+1
source share

All Articles