简体   繁体   English

在32位进程下运行的GhostscriptLibraryNotInstalledException需要本机库

[英]GhostscriptLibraryNotInstalledException running under 32-bit process requires native library

Using nuget in Visual Studio 2013, I installed Ghostscript.NET into my project on my Windows x64 PC. 在Visual Studio 2013中使用nuget,我在我的Windows x64 PC上将Ghostscript.NET安装到我的项目中。

Just to make sure I wasn't crazy, I checked it: 为了确保我没有疯狂,我检查了一下:

PM> Install-Package Ghostscript.NET
'Ghostscript.NET 1.2.0' already installed.
Project already has a reference to 'Ghostscript.NET 1.2.0'.

PM> 

The project is used by multiple developers. 该项目由多个开发人员使用。 It targets Any CPU, and needs to remain that way. 它针对任何CPU,并且需要保持这种状态。

Here is my code: 这是我的代码:

public static void GhostscriptNetProcess(String fileName, String outputPath)
{
    var version = GhostscriptVersionInfo.GetLastInstalledVersion();
    var source = (fileName.IndexOf(' ') == -1) ? fileName : String.Format("\"{0}\"", fileName);
    var output_file = (outputPath.IndexOf(' ') == -1) ? outputPath : String.Format("\"{0}\"", outputPath);
    var gsArgs = new List<String>();
    gsArgs.Add("-q");
    gsArgs.Add("-dNOPAUSE");
    gsArgs.Add("-dNOPROMPT");
    gsArgs.Add("-sDEVICE=pdfwrite");
    gsArgs.Add(String.Format(@"-sOutputFile={0}", output_file));
    gsArgs.Add("-f");
    gsArgs.Add(source);
    var processor = new GhostscriptProcessor(version, false);
    processor.Process(gsArgs.ToArray());
}

Whenever I attempt to debug the application, I get the following error message: 每当我尝试调试应用程序时,都会收到以下错误消息:

GhostscriptLibraryNotInstalledException was unhandled GhostscriptLibraryNotInstalledException未处理

An unhandled exception of type 'Ghostscript.NET.GhostscriptLibraryNotInstalledException' occurred in Ghostscript.NET.dll Ghostscript.NET.dll中出现未处理的“Ghostscript.NET.GhostscriptLibraryNotInstalledException”类型异常

Additional information: This managed library is running under 32-bit process and requires 32-bit Ghostscript native library installation on this machine! 附加信息:此托管库在32位进程下运行,需要在此计算机上安装32位Ghostscript本机库! To download proper Ghostscript native library please visit: http://www.ghostscript.com/download/gsdnld.html 要下载正确的Ghostscript本机库,请访问: http//www.ghostscript.com/download/gsdnld.html

截图

Looking up the Ghostscript.NET.GhostscriptLibraryNotInstalledException did not provide any useful information, though this post on CodeProject indicated that the debugger is running in 32-bit mode whereas I have the 64-bit version installed. 查看Ghostscript.NET.GhostscriptLibraryNotInstalledException没有提供任何有用的信息,虽然CodeProject上的这篇文章表明调试器在32位模式下运行,而我安装了64位版本。

That's all well and good know, but how do I go about testing the new code I wrote that uses Ghostscript? 这一切都很好,但我怎么去测试我编写的使用Ghostscript的新代码?

If you are testing with MS Test you have to set the processor architecture in which the tests are run, because Ghostscript.Net verifies the process architecture (Environment.Is64BitProcess) to search for the ghostscript installation in the registry. 如果使用MS Test进行测试,则必须设置运行测试的处理器体系结构,因为Ghostscript.Net会验证进程体系结构(Environment.Is64BitProcess)以在注册表中搜索ghostscript安装。

In Menu > Test > Test Settings > Default Processor Architecture > X64. 在菜单>测试>测试设置>默认处理器体系结构> X64中。

Have you actually installed Ghostscript ? 你真的安装了Ghostscript吗?

Ghostscript.NET is merely a .NET interface to Ghostscript, it looks to me like the message: Ghostscript.NET只是Ghostscript的.NET接口,它在我看来就像消息:

"This managed library is running under 32-bit process and requires 32-bit Ghostscript native library installation on this machine! To download proper Ghostscript native library please visit: http://www.ghostscript.com/download/gsdnld.html " “此托管库在32位进程下运行,需要在此计算机上安装32位Ghostscript本机库!要下载正确的Ghostscript本机库,请访问: http//www.ghostscript.com/download/gsdnld.html

is trying to tell you that you don;t have a 32-bit version of Ghostscript installed. 试图告诉你,你没有安装32位版本的Ghostscript。 It even tells you where to go to download a copy. 它甚至会告诉你去哪里下载副本。

So have you installed Ghostscript ? 你安装了Ghostscript吗? Have you installed the 32-bit version of Ghostscript ? 你安装了32位版本的Ghostscript吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用32位应用程序中的64位库 - Use 64-bit library from 32-bit application 为什么我的应用程序(我使用Any CPU编译)在我的64位计算机上作为32位进程运行? - Why is my application, which I compiled with Any CPU, running as a 32-bit process on my 64-bit machine? Windows Docker容器中未启动32位进程 - 32-bit process not started in windows docker container C# - 是否有 32 位浮点数学库? - C# - Is there a 32-bit float math library? 为什么OleDbConnection在64位进程上引发InvalidOperationException而在32位进程上引发OleDbException - Why OleDbConnection throws InvalidOperationException on 64-bit process and OleDbException on 32-bit process CLR /从32位进程切换到64位进程后的高内存消耗 - CLR / High memory consumption after switching from 32-bit process to 64-bit process 使用WMI,如何确定远程进程是32位还是64位? - Using WMI, how can I determine whether a remote process is 32-bit or 64-bit? 在64位环境中将指定的NUnit测试作为32位进程运行 - Run a specified NUnit test as a 32-bit process in a 64-bit environment Visual Studio 中的“首选 32 位”在控制台应用程序 (.NET Core) 下生成 64 位代码 - 'Prefer 32-bit' in Visual Studio Generates 64-bit Code Under Console App (.NET Core) 在32位整数上按位与 - Bitwise AND on 32-bit Integer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM