PDFLib .NET Deploy Tip (specified module could not be found)

We’re using the ASP.NET C# version of PDFLib at work to generate loads of reports and cool pdf files. Everything was peachy on our development systems until we deployed to staging servers, then all of the sudden we started getting the following exception on the site:

The specified module could not be found.
(Exception from HRESULT: 0x8007007E)

Not one of Microsoft’s more useful error messages, to be true and googling for that error returns so many diverse topics that they were completely useless.

So after a bit of troubleshooting, we came to the following solution tips. These should work for both C# and VB and any other .NET language. Tested on Windows 2003 and Windows Server 2008.

Make sure your webserver is 32-bit

PDFLib for .NET does not support 64-bit servers. In theory you could run your IIS worker processes in 32-bit on a 64-bit OS, but I leave that as an exercise to the reader.

Make sure you have .NET 1.1 installed

Because pdflib_dotnet.dll is built on 1.1 and you will have this installed on your development box, you will never think about this for your prod/staging servers. If you already have IIS installed before you run the 1.1 installer, don’t forget to register it with IIS:

C:\Windows\Microsoft.NET\Framework\v1.1.xxxxx\aspnet_regiis.exe -ir

Put the MSVCR71.DLL into your web bin directory

On your development machine (or wherever you have PDFLib actually installed) the msvcr71.dll will be in C:\Program Files\PDFlib\PDFlib 32-bit 7.0.3\dotNET\bin or thereabouts. Drop that into your website bin directory on the server.

UPDATE: You may also need to place this dll into the C:\Windows\System32 folder on a dedicated server.

Reboot, then check it out.

Taste the sweet goodness of success.

PDFLib produces a great end product (and it should for that much caaaassssshh). But it has many weird cases. Probably because it seems that the .NET version is just a simple crappy wrapper on the C library. Oh well. It’s still the best thing on the market to separate your developers from your designers.


3 Responses to “PDFLib .NET Deploy Tip (specified module could not be found)”

  • Cosmin Says:

    Hi

    Did you try using PDFLibNet in .NET Framework 4.0 (ASP NET with C#)? It throws an error when instantiating PDFWrapper p = new PDFWrapper()…something about “Method cannot be final”. I believe those methods should have been declared as virtual in the PDFLibNet source code. If you have a workaround for this problem, please let me know.

    Thanks in advance.

  • Ian Parks Says:

    Thanks so much for figuring this out.
    I tried for hours with no luck.
    You would think that the folks at pdfLib would put something in their support site about this.

Leave a Reply