How do I resolve 'FileNotFoundException: Could not load file or assembly 'PDFNet.dll' or one of its dependencies' [64-bit and .NET 4 specific]?

2,354 views
Skip to first unread message

Support

unread,
Nov 30, 2010, 5:08:27 PM11/30/10
to PDFTron PDFNet SDK
Q: I have added the PDFNet.dll to the Bin folder of my .Net ASP
project. Included it as a resource and it runs great in dev. I
deployed the website to production and get the following error. The
DLL is in the Bin folder of the website. Is there something else I
need to do?

[FileNotFoundException: Could not load file or assembly 'PDFNet.dll'
or one of its dependencies. The specified module could not be found.]

------------------
A: What is the variant of PDFNet that you are using (i.e. the name of
the ZIP file you downloaded from pdftron website)?

>>>>>>>>>>
In case of PDFNet for .NET 4.0 you need VC 2010 redistributable on
your system (MSVCP100.DLL and MSVCR100.DLL). This is a standard
component of Visual Studio. In case your target machine does not
include this redistributable you can download it from here:

Microsoft VC 2010 Redistributable Package (x86):
microsoft.com/downloads/en/details.aspx?familyid=A7B7A05E-6DE6-4D3A-
A423-37BF0912DB84

or

Microsoft VC 2010 Redistributable Package (x64):
microsoft.com/downloads/details.aspx?
familyid=BD512D9E-43C8-4655-81BF-9350143D5867

You can either install the redistributable on the target machine or
you can copy the above mentioned DLL in the same folder as PDFNet.

>>>>>>>>>>
In case you are using VS2008 and 64-bit version of PDFNet 1.1-3.5
(i.e. PDFNet64.zip) you would need Microsoft VC 2008 Redistributable
Package (x64):

microsoft.com/downloads/en/details.aspx?
FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf

In case you are using PDFNet.zip (i.e. 32-bit version of PDFNet for
1.1-3.5), there is no need to install any redistributable package.

Aaron

unread,
Dec 6, 2016, 5:35:05 PM12/6/16
to PDFTron PDFNet SDK
Note also that if you are targeting x64, you need to remove the 32bit PDFNet assembly reference form the project, and add the 64bit one, and make sure that copylocal:true is set.


Gowtham CV

unread,
Jun 10, 2020, 12:02:48 PM6/10/20
to PDFTron PDFNet SDK
Hi..

I have PDFNet x64 for .Net 4.0 and VC++ already installed. But I am still facing this error. Please let me know what could be the possible reason?

Regards,
Gowtham C

Ryan

unread,
Jun 10, 2020, 4:44:26 PM6/10/20
to PDFTron PDFNet SDK
Please post the full error message you see.

Gowtham CV

unread,
Jun 11, 2020, 2:55:30 PM6/11/20
to PDFTron PDFNet SDK
Hi,

Please find the full message below.

Exception": {
        "Name""FileNotFoundException",
        "Message""Could not load file or assembly 'PDFNet, Version=6.2.1.23937, Culture=neutral, PublicKeyToken=36167be3f67ac39c' or one of its dependencies. The system cannot find the file specified."
    }

Also please find the PDFNet dll stored in the G Drive

Regards,
Gowtham C

Ryan

unread,
Jun 11, 2020, 3:51:57 PM6/11/20
to PDFTron PDFNet SDK
" or one of its dependencies."
Most likely this is the VC++ runtime dependency.

For PDFNet versions 7.0 and older, this is the VC++ 2010 runtimes. Starting with PDFNet 7.1 it is now the VC++ 2013 runtimes.

Please download the installer from MS and install on the target system, or add to your installer/deployment system to automate.

Gowtham CV

unread,
Jun 16, 2020, 11:36:49 AM6/16/20
to PDFTron PDFNet SDK
Hi Ryan,

I am having VC++ redistributable 2012 and above. So unable to install 2010 VC++. The issue can be resolved by placing PDFNet dll in the bin folder. However we are facing issue in the service fabric environment.

    Exception type: ConfigurationErrorsException

    Exception message: Could not load file or assembly 'PDFNet.DLL' or one of its dependencies. The specified module could not be found.

Ryan

unread,
Jun 16, 2020, 12:05:28 PM6/16/20
to PDFTron PDFNet SDK
This error means either PDFNet.dll was not found, or one of the VC++ 2013 redistributables was not found.

You can try ProcessMonitor from SysInternals to see what is not being found, or perhaps Windows Event Viewer has info.

Otherwise you need to review your "service fabric" documentation, to find out how to load dependencies.

Gowtham CV

unread,
Oct 20, 2020, 1:12:44 PM10/20/20
to PDFTron PDFNet SDK
Can this VC++ dlls can be added as part of application depdencies? If yes, what dlls to be added. (note: our Service fabric node is empty and we are installing only our application on that) ?

Regards,
Gowtham C

Ryan

unread,
Oct 21, 2020, 11:41:38 AM10/21/20
to PDFTron PDFNet SDK
Sorry it is unclear what you are asking here.

The "application" is yours.

Since the VC++ runtimes are Not .NET assemblies I don't think you can depend on them the same way in Visual Studio, they just have to be made available. But since they are a Microsoft dependency you should be able to find lots of documentation about them.
Reply all
Reply to author
Forward
0 new messages