从(a)GhostScriptAPI加载gsdll64.dll突然抛出BadImageFormatException

时间:2016-10-18 16:14:50

标签: c# asp.net .net ghostscript

我在大约一个月前安装了GhostScript 9.19 x64,以便在.NET 4 Web应用程序中使用,从那时起它一直运行良好。

在最近的源代码控制签入(自安装GS之后的第一个)之后,我的GhostScriptAPI包装器现在抛出 BadImageFormatException

enter image description here

[DllImport("c:\\gsdll64.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern int gsapi_new_instance(out IntPtr lngGSInstance, IntPtr lngCallerHandle);

intReturn = gsapi_new_instance(out intGSInstanceHandle, callerHandle);

即使应用程序配置为定位"任何CPU" ,如果 x64 ,它将无法加载BadImageFormatException明确设置,因此它实际上是针对 x86

enter image description here

我意识到我需要使用 x86 版本的GhostScript(gsdll32.dll)或让我的应用程序在 x64 上运行,但我的问题是 GhostScript如何预先在我的应用程序中工作,并且它针对两个不同的平台(运气,魔法,神圣干预)?

0 个答案:

没有答案
相关问题