我从Nuget Manager安装了PDFSharp/MigraDoc,并尝试使用它。当我尝试编写PDF时,它会给出以下错误:
无法加载文件或程序集“PdfSharp、Version=1.32.3057.0、Culture=neutral、PublicKeyToken=f94615aa0424f9eb”或其依赖项之一。所定位的程序集的清单定义与程序集引用不匹配。(HRESULT例外: 0x80131040)
它给了我一个程序集负载跟踪,如下所示:
=== Pre-bind state information ===
LOG: DisplayName = PdfSharp, Version=1.32.3057.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb
(Fully-specified)
LOG: Appbase = file:///C:/Users/jh/Documents/GitHub/Base1.5/Website/
LOG: Initial PrivatePath = C:\Users\jh\Documents\GitHub\Base1.5\Website\bin
Calling assembly : MigraDoc.Rendering, Version=1.32.4334.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\jhop\Documents\GitHub\Base1.5\Website\web.config
LOG: Using host configuration file: C:\Users\jhop\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: PdfSharp, Version=1.32.3057.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb
LOG: Attempting download of new URL file:///C:/Users/jh/AppData/Local/Temp/Temporary ASP.NET Files/vs/81f4fd95/d5ff50bc/PdfSharp.DLL.
LOG: Attempting download of new URL file:///C:/Users/jh/AppData/Local/Temp/Temporary ASP.NET Files/vs/81f4fd95/d5ff50bc/PdfSharp/PdfSharp.DLL.
LOG: Attempting download of new URL file:///C:/Users/jh/Documents/GitHub/Base1.5/Website/bin/PdfSharp.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.我能做些什么来解决这个问题?
发布于 2017-11-07 14:33:14
请注意,MigraDoc包包括PDFsharp,因此不要将PDFsharp和MigraDoc作为单独的包安装于NuGet。
不同的版本号1.32.4334和1.32.3057表明您安装了不同且不兼容的NuGet包,或者可能引用了根本不来自NuGet的程序集。
https://stackoverflow.com/questions/47160116
复制相似问题