我在 mvc3 Web 应用程序中使用 Magick.net 库,这些是我所做的步骤
我的项目以 AnyCPU 为目标,我的机器是 64 位
将 Magick.NET-x64.dll 的引用添加到项目中。从此处http://www.microsoft.com/en-us/download/details.aspx?id=30679为 Visual Studio 2012 Update 4 安装了 Visual C++ Redistributable 在
机器上安装了适用于 Windows(64 位)的 Ghostscript 9.14 添加
<add assembly="Magick.NET-x64, Version=7.0.0.0002, Culture=neutral, PublicKeyToken=2004825badfa91ec" />
在 web.config 文件上
项目已成功重建 [所有 dll 也都在 bin 文件夹中],但在运行时出现异常
无法加载文件或程序集“Magick.NET-x64”或其依赖项之一。试图加载格式不正确的程序。
说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取更多信息 > 关于错误及其源自代码的位置。
异常详细信息: System.BadImageFormatException:无法加载文件或程序集“Magick.NET-x64”或其依赖项之一。> 试图加载格式不正确的程序。
源错误:
在执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关 > 异常的来源和位置的信息。程序集加载跟踪:以下信息有助于确定无法加载程序集“Magick.NET-x64”的原因。
=== 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.