Blog Post

Using different versions of a DLL in a project

Shrevin Sookun
Illustration: Using different versions of a DLL in a project

The Aquaforest OCR SDK makes use of two libraries that can cause problems if referenced individually in a project. The two libraries in question are:

  • iTextSharp

  • Log4Net If your application makes use of any of these 2 libraries in addition to the Aquaforest SDK, you will need some additional configuration to be able to compile it. For instance, let’s say your application uses the most recent version of iTextSharp and you are also referencing the Aquaforest SDK, which uses an old version of iTextSharp (4.1.6.0). If you try to compile the application you will end with an error as follows:**Error in OCR Processing: Method not found: 'System.Collections.Hashtable iTextSharp.text.pdf.PdfReader.get_Info()'.**To fix this, you will need to do the following:

  1. Rename the new version of itextsharp. In this example, it’s been renamed to “itextsharp_new.dll”.

  2. Add a reference to “itextsharp_new.dll” to your project.

  3. Modify your app.config file as follows:

2

If you cannot rename the new itextsharp DLL, you can do the following:

  1. Add a reference to the new version of the itextsharp.dll to your project.

  2. Set “ Copy Local ” to False.

3

  1. Create a folder in your bin directory and place the itextsharp.dll in it. In this example, the folder has been renamed to “itextsharp-5.5.8”

  2. Modify your app.config file as follows:

4

You can get the public token of a DLL by running the following command from the Visual Studio command prompt. Note that the arguments are case sensitive. sn -T <assemblyname>

1

Author
Shrevin Sookun Software Development Manager

Shrevin is a software engineer with a focus on Microsoft technologies and solutions, including SharePoint, Power Automate, and Azure. In his spare time, he enjoys hiking, trail biking, and watching movies.

Explore related topics

Share post
Free trial Ready to get started?
Free trial