I'm trying to use a 3rd party DLL (PDFExtract from 3-Heights) in my VB.NET project. The package comes with 2 .NET DLL's that I should add as references in the project as per the manual and a third native DLL that I need to add as an existing item to the project.
The help says:"The 3-Heights™ PDF Extract API does not provide a pure .NET solution. Instead, it consists of .NET assemblies, which are added to the project and a native DLL, which is called by the .NET assemblies. This has to be accounted for when installing and deploying the tool."
I followed the steps exactly but I get the following error when I try to initialize an object from the DLL: "An unhandled exception of type 'System.TypeInitializationException' occurred in MyProject.exe Additional information: The type initializer for 'Pdftools.PdfExtract.Document' threw an exception."
According to the help manual, this is an indication that windows cannot find the native DLL.
The downloaded package contains sample VB.NET project which surprisingly runs without a problem. I compared both projects and can't find anything different related to the problem. If I take that sample project as a starting point and then add my files on top of it and call my procedures, the code will work! There must be some setting or link that I'm missing in my project. Any idea?
My problem is that I want to create a DLL so I need a new class library project. Hence, I can't start from the sample project which is a Windows Form project.
My question is: are there any hidden settings or links to the DLL that could available in the sample project and not in mine? otherwise, what could be the reason for what I'm seeing?
Copy AlwaysorCopy If Newerso that the linker copies the dll to your build path. Also better to set the compiler option toNone. - bansi