gpt4 book ai didi

c# - Visual Studios 2015 NuGet Ghostscript 安装错误

转载 作者:行者123 更新时间:2023-11-30 21:38:13 27 4
gpt4 key购买 nike

我似乎不知道如何解决 gsdll32 的安装错误

我正在运行 64 位 Windows 和 visual studio 2015。我唯一能想到的是 nuget 试图在 64 位版本的 visual studio 上安装 32 位 dll。但我似乎无法与其他任何人确认这个错误。我需要 Ghostscript 将网站上的 PDF 转换为 JPG。如果您有 Ghostscript 的替代品,请告诉我。 Visual Studios 安装 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

最佳答案

Visual Studios 2015 NuGet Ghostscript Installation Error

那是因为 gsdll32.dll 是 native dll,而不是非托管 .NET 库。所以你不能在你的项目中安装它。您可以下载该包并将 dll 文件作为“内容”包含到您的项目中,并将属性“复制到输出目录”的值设置为“始终复制”。

可以引用How to use Ghostscript for converting PDF to Image有关直接调用 GhostScript dll 的更多详细信息。

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

关于c# - Visual Studios 2015 NuGet Ghostscript 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46206933/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com