簡體   English   中英

在32位進程下運行的GhostscriptLibraryNotInstalledException需要本機庫

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

在Visual Studio 2013中使用nuget,我在我的Windows x64 PC上將Ghostscript.NET安裝到我的項目中。

為了確保我沒有瘋狂,我檢查了一下:

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

PM> 

該項目由多個開發人員使用。 它針對任何CPU,並且需要保持這種狀態。

這是我的代碼:

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());
}

每當我嘗試調試應用程序時,都會收到以下錯誤消息:

GhostscriptLibraryNotInstalledException未處理

Ghostscript.NET.dll中出現未處理的“Ghostscript.NET.GhostscriptLibraryNotInstalledException”類型異常

附加信息:此托管庫在32位進程下運行,需要在此計算機上安裝32位Ghostscript本機庫! 要下載正確的Ghostscript本機庫,請訪問: http//www.ghostscript.com/download/gsdnld.html

截圖

查看Ghostscript.NET.GhostscriptLibraryNotInstalledException沒有提供任何有用的信息,雖然CodeProject上的這篇文章表明調試器在32位模式下運行,而我安裝了64位版本。

這一切都很好,但我怎么去測試我編寫的使用Ghostscript的新代碼?

如果使用MS Test進行測試,則必須設置運行測試的處理器體系結構,因為Ghostscript.Net會驗證進程體系結構(Environment.Is64BitProcess)以在注冊表中搜索ghostscript安裝。

在菜單>測試>測試設置>默認處理器體系結構> X64中。

你真的安裝了Ghostscript嗎?

Ghostscript.NET只是Ghostscript的.NET接口,它在我看來就像消息:

“此托管庫在32位進程下運行,需要在此計算機上安裝32位Ghostscript本機庫!要下載正確的Ghostscript本機庫,請訪問: http//www.ghostscript.com/download/gsdnld.html

試圖告訴你,你沒有安裝32位版本的Ghostscript。 它甚至會告訴你去哪里下載副本。

你安裝了Ghostscript嗎? 你安裝了32位版本的Ghostscript嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM