winformscitrixpdftronpdfnet

How to configure PDFNet for .NET application to publish to Citrix server? (AnyCPU)


So I have been trying to config the project to make it work on our server via Citrix.

I used this line of code to set the path:

private static pdftron.PDFNetLoader loader = pdftron.PDFNetLoader.Instance().Path(String.Format(@"{0}\{1}",
        System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(IndexUIZoom)).Location), @"PDFNet"));

I got this error every time (bin is where the .exe file is):

INFO  Program [(null)] - Path: [bin]\PDFNet -

ERROR Program [(null)] - System.IO.FileNotFoundException: Could not load file or assembly 'PDFNet.dll' or one of its dependencies.
The specified module could not be found. File name: 'PDFNet.dll'

Everything works fine on local machine. I got the error above whenever I run from Citrix, or log into the server machine and run from there.


Solution

  • Most likely your server is missing the MS VC++ Runtime dependencies. Developer machines usually have them installed as part of a Visual Studio installation, but servers often do not. You can download MS VC++ installers from MSDN.

    To find the exact one you need to download please see section 3.2.1 of the Getting Started Guide for PDFNet .Net below. Note you need to also match the runtime 32 or 64 bitness of your process, for both PDFNet.dll and the MS VC++ runtime.

    PDFNet .Net 4.0+ Getting Started Guide

    PDFNet .Net 2.0-3.5 Getting Started Guide

    https://www.pdftron.com/documentation/windows/guides