在同一个项目中使用Spire.doc,Spire.xls和Spire.Presentation

时间:2014-07-07 19:07:24

标签: c# asp.net-mvc spire

是否可以在同一项目中使用3种产品?

刚下载了每个版本的免费版本,Spire.PDF.dll版本不同,导致错误" System.IO.FileLoadException: Could not load file or assembly 'Spire.Pdf, Version=3.0.10.54040, Culture=neutral, PublicKeyToken=663f351905198cb3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

Spire.doc使用版本3.0.10.54040,Spire.Presentation使用3.0.49.58040

我尝试使用dependentAssembly

  <dependentAssembly>
    <assemblyIdentity name="Spire.Pdf" publicKeyToken="663f351905198cb3" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.10.54040" newVersion="3.0.49.58040" />
  </dependentAssembly>

但是收到错误

TypeLoadException: Could not load type 'sprẒ' from assembly 'Spire.Pdf,
Version=3.0.49.58040, Culture=neutral, PublicKeyToken=663f351905198cb3'.

2 个答案:

答案 0 :(得分:0)

在同一个项目中不能使用三个库。您可以下载免费的Spire.Office,其中包括Spire.Doc,Spire XLS,Spire.Presentation,Spire.PDF,Spire.DataExport,Spire.PDFViewer,Spire.DocViewer等库。使用Spire.Office,您可以在同一个项目中使用Spire.Doc,Spire.Presention和Spire.Xls库。

答案 1 :(得分:0)

清除“ dependentAssembly”部分,该部分完全引用了“ app.config”文件中的Spire Dll。那对我有用。