Q. I'm using Toolkit 10.1.0 (or later), referencing APToolkitNET.dll located in C:\Program Files\ActivePDF\Toolkit\bin\x64\ and the following code throws an exception when calling the Toolkit constructor:
using (APToolkitNET.Toolkit tk = new APToolkitNET.Toolkit())
"System.ArgumentException: 'Core library not loaded Parameter name: Toolkit'"
A. There are some changes in the Toolkit installation beginning with 10.1.0. Please see Toolkit Release Notes 10.1.0
Starting with TK 10.1.0, the core Toolkit files are no longer installed in the "C:\Windows\System32" or "C:\Windows\SysWOW64" folders. The files are installed in the folder "C:\Program Files\ActivePDF\Toolkit\bin". You must either update your .NET application to explicitly reference the location of the Toolkit files or place them in your applications working directory.
The following is an example to load the Toolkit core DLLs located "C:\Program Files\ActivePDF\Toolkit\bin\x64":
// Note: 32b applications reference the x86 folder.
// Note: Use the default constructor if placing the Toolkit core DLLs in your applications working directory.
string toolkitPath = $@"{Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)}\ActivePDF\Toolkit\bin\x64";
APToolkitNET.Toolkit oTK = new APToolkitNET.Toolkit(toolkitPath);
(The above example is for Toolkit, for Toolkit Ultimate the correct path is "\ActivePDF\Toolkit Ultimate\...")
== Notes for 64-bit project & NuGet download ==
ActivePDF provides NuGet packages for 64b Toolkit and Toolkit Ultimate. Installing the Toolkit NuGet package will copy the .NET and core DLLs to your 64b applications working directory, use the Toolkit default constructor in this case.
== Update == Web Apps
Issue: Console applications work with the information above, but Web applications fail.
After further investigation, we found it worked on a certain machine because Toolkit 9.1.0 or below installed the core in the system32 and SysWOW64 folders. If installing Toolkit 10.1.0 on a fresh, clean machine that never previously had Toolkit installed the Web application fails.
For Web applications Toolkit 10.1 searches the system32 or SysWOW64 folders for the DLLs. The installers do not not copy the DLLs in those folder.
Solution:
- Copy the 32b or 64b core DLLs to the corresponding Windows system folder.
Comments
0 comments
Please sign in to leave a comment.