视觉工作室2015年的NuGet Ghostscript的安装错误

问题描述:

我似乎无法弄清楚如何修复gsdll32视觉工作室2015年的NuGet Ghostscript的安装错误

此安装错误,我运行64位Windows和视觉工作室2015年我能想到的唯一的事情就是nuget试图在64位版本的视觉工作室上安装32位dll。但我似乎无法与其他人确认这个错误。我需要Ghostscript在网站上将PDF转换为JPG。如果你有Ghostscript的替代品,请告诉我。视觉工作室安装Ghostscript.NET就好了。但它在ghostscript本身上失败。

PM> Install-Package Ghostscript -Version 9.2.0 
Attempting to gather dependency information for package 'Ghostscript.9.2.0' with respect to project 'wilcox_fresh', targeting '.NETFramework,Version=v4.6.1' 
Gathering dependency information took 845.32 ms 
Attempting to resolve dependencies for package 'Ghostscript.9.2.0' with DependencyBehavior 'Lowest' 
Resolving dependency information took 0 ms 
Resolving actions to install package 'Ghostscript.9.2.0' 
Resolved actions to install package 'Ghostscript.9.2.0' 
Retrieving package 'Ghostscript 9.2.0' from 'nuget.org'. 
Adding package 'Ghostscript.9.2.0' to folder 'C:\Users\Neoaptt\Source\Repos\wilcoxfreshsite\packages' 
Added package 'Ghostscript.9.2.0' to folder 'C:\Users\Neoaptt\Source\Repos\wilcoxfreshsite\packages' 
Install failed. Rolling back... 
Package 'Ghostscript.9.2.0' does not exist in project 'wilcox_fresh' 
Removing package 'Ghostscript.9.2.0' from folder 'C:\Users\Neoaptt\Source\Repos\wilcoxfreshsite\packages' 
Removed package 'Ghostscript.9.2.0' from folder 'C:\Users\Neoaptt\Source\Repos\wilcoxfreshsite\packages' 
Executing nuget actions took 460.6 ms 
Install-Package : Failed to add reference to 'gsdll32'. 
At line:1 char:1 
+ Install-Package Ghostscript -Version 9.2.0 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    + CategoryInfo   : NotSpecified: (:) [Install-Package], Exception 
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand 

Time Elapsed: 00:00:01.4721036 
+0

有时,当在新电脑上重新打开回购站时,我的nuget引用被搞砸了,我必须执行update-package Ghostscript -reinstall。这可能是这种情况,还是仅仅是一个新项目? – Carter

+0

ghostscript从未安装过。安装失败。 – Neoaptt

+1

如果你想安装Ghostscript,我建议你使用Windows安装程序,它可以从ghostscript.com网站下载(在下载下)。一旦安装,DLL将可用(以及其他一切)。请注意,Ghostscript是根据AGPL授权的,涵盖了其用于软件即服务的情况,以防您在商业上使用此软件。我刚刚检查了NuGet软件包,但没有包含违反AGPL的许可证。我会安排联系维护者并讨论这个问题。 – KenS

视觉工作室2015年的NuGet Ghostscript的安装错误

,由于gsdll32.dll是本地的dll,而不是一个没有管理的.NET库。所以你不能在你的项目中安装它。您可以下载该软件包并将dll文件作为“内容”添加到项目中,并将属性“Copy to Output Directory”的值设置为“Copy Always”。

你可以参考How to use Ghostscript for converting PDF to Image了解更多关于直接调用GhostScript dll的信息。

此外,我们可以期待下一个版本的Ghostscript软件包。