0

I am trying to generate PDFs using ABCPdf.net on c# .net MVC web application. While loading the solution, I am getting the below error:

Could not load file or assembly 'ABCpdf, Version=10.1.2.5,
Culture=neutral, PublicKeyToken=a7a0b3f5184f2169' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

The issue is ABCPdf.dll version in the bin folder is always loading version 1.0.0.0 while the application requires version 10.1.2.5. I am not sure from where the dll version 1.0.0.0 is getting loaded.

I performed the below operations, hoping for good results, but didn't solve the issue:

  • Removed the reference and added it again

  • Cleaned solution and rebuilt again

  • Tried removing the dll version 1.0.0.0 manually from the bin folder and pasted version 10.1.2.5. But when I ran VS2015 again, the bin folder replaces the dll version 1.0.0.0 to 10.1.2.5

  • Deleted everything from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files

Jesse C. Slicer
  • 19,901
  • 3
  • 68
  • 87
winterishere
  • 350
  • 1
  • 5
  • 21

1 Answers1

0

Here are few things you should try:

  1. GAC - You may have ABC pdf installed on your system and assembly probe picking the version from GAC.
  2. Use binding redirection attribute in you web.config to deal with multiple versions.
  3. Edit your web project file and add hint path for the DLL in project references.

Use fusion log viewer to enable and explore the logs. Launch VS Developer command prompt console type 'fuslogvw' to run the Fusion log viewer.

Analyze the logs for ABCPDF after running the application again or post them here.

vendettamit
  • 14,315
  • 2
  • 32
  • 54
  • Thanks vendettamit for the suggestion. I tried all the steps but no result: 1. I searched my GAC it doesn't contain any abcpdf reference. 2. Binding redirection will work if that particular version dll(10.1.2.5) will be present in bin folder. 3. My web project file contains correct path to access dll version 10.1.2.5. which is not in bin folder. – winterishere Sep 22 '17 at 17:27
  • Enable fusion log and run your application. Look at the locations the binder is trying to search for this assembly. Add the logs in your question. – vendettamit Sep 22 '17 at 17:31
  • Running fusion log tells me same thing. App is looking in bin folder for dll version 10.1.2.5. That's what the problem is when i replace dll version 1.0.0.0 with 10.1.2.5, VS again replaces it with 1.0.0.0 when application runs. so system is not able to find correct version of the dll. LOG: Initial PrivatePath = c:\users\xxxx\documents\visual studio 2015\Projects\ABCPdf\ABCPdf\bin – winterishere Sep 22 '17 at 18:04
  • After exhausting all the options, i created a brand new VS solution. Added the reference, written code for abcpdf.net. and wow it ran..bin folder doesn't contain dll version 1.0.0.0 but refers to version 10.1.2.5. I am wondering where i was wrong.. :) – winterishere Sep 22 '17 at 19:00
  • Compare the references in previous project and new project. I'm sure you had something in the old project which had reference to the version 1.0.0.0. May in references of some other project that you may have referenced in old project. – vendettamit Sep 22 '17 at 19:31