[英]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: 每当我尝试调试应用程序时,都会收到以下错误消息:
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位版本。
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.