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:
-
Rename the new version of itextsharp. In this example, it’s been renamed to “itextsharp_new.dll”.
-
Add a reference to “itextsharp_new.dll” to your project.
-
Modify your app.config file as follows:
If you cannot rename the new itextsharp DLL, you can do the following:
-
Add a reference to the new version of the itextsharp.dll to your project.
-
Set “ Copy Local ” to False.
-
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”
-
Modify your app.config file as follows:
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>