我在我的应用程序中使用itextsharp
生成pdf并且它工作正常。但在过去几天我收到以下错误
"Could not load file or assembly 'itextsharp, Version=5.5.9.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)"
我检查了bin文件夹中的dll并且确定dll版本是5.5.8.0
并且webconfig看起来像这样
<dependentAssembly>
<assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.8.0" newVersion="5.5.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="itextsharp.xmlworker" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.8.0" newVersion="5.5.8.0" />
</dependentAssembly>
它是托管相关问题还是我们方面的问题?
答案 0 :(得分:0)
似乎正在更新dll引用,但不是web.config。尝试将您的web.config更新为版本5.5.9.0,如下所示。
<dependentAssembly>
<assemblyIdentity name="itextsharp" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.8.0" newVersion="5.5.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="itextsharp.xmlworker" publicKeyToken="8354ae6d2174ddca" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.8.0" newVersion="5.5.9.0" />
</dependentAssembly>