gpt4 book ai didi

c# - 无法在 mvc 应用程序上加载文件或程序集 'Magick.NET-x64' 问题

转载 作者:可可西里 更新时间:2023-11-01 08:58:08 25 4
gpt4 key购买 nike

我在 mvc3 网络应用程序中使用 Magick.net 库,这些是我执行的步骤

我的项目是针对 AnyCPU 的,我的机器是 64 位的
将 Magick.NET-x64.dll 的引用添加到项目中。从此处安装 Visual C++ Redistributable for Visual Studio 2012 Update 4 http://www.microsoft.com/en-us/download/details.aspx?id=30679在机器上安装适用于 Windows(64 位)的 Ghostscript 9.14添加

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

在 web.config 文件上

项目已成功重建 [并且所有 dll 也在 bin 文件夹中],但在运行时出现异常

Could not load file or assembly 'Magick.NET-x64' or one of its dependencies. An attempt was made to load a program with an incorrect format.

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

Exception Details: System.BadImageFormatException: Could not load file or assembly 'Magick.NET-x64' or one of its dependencies. An attempt was > made to load a program with an incorrect format.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the > exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Magick.NET-x64' could not 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.

最佳答案

blog post 的修订由@dlemstra 选址有我为此找到的最简单的解决方案:

在 VS2013/2015 中,转到工具 --> 选项 --> 项目和解决方案 --> Web 项目并选择“为网站和项目使用 64 位版本的 IIS Express”。

Use 64 bit IIS Express

关于c# - 无法在 mvc 应用程序上加载文件或程序集 'Magick.NET-x64' 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25638577/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com