Unable to load DLL 'DPDFRenderNative_x86'

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Rasterizer for .NET (v2)  /  Re: Unable to load DLL 'DPDFRenderNative_x86'

DynamicPDF Rasterizer for .NET (v2) Forum

Side note, your Forum dropdown when posting a new message does not list Rasterizer v3.

I'm getting "Unable to load DLL 'DPDFRenderNative_x86': The specified module could not be found." on a published app when it worked fine locally on my dev machine. Full error at the end.

It seems to work fine on my machine regardless if I specify x86 or x64. It's a .NET Framework 4.8 app running under ASP.NET Core. I'm using the most recent nuget package in my project for this.
When I check the folder on our server, both the 32 and 64 bit files are in the same folder as the apps main executable. I though maybe I was missing a dependency, but the documentation says no VC++ redist is needed for DynamicPDF.Rasterizer.NETFramework40.dll. I tried adding it anyway (the 2015-2019 version), but it had no impact.

The server is running 2012 R2, but I don't think that's related in this case?

Not sure how else to troubleshoot this one.

 An unhandled exception occurred while processing the request.
DllNotFoundException: Unable to load DLL 'DPDFRenderNative_x86': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
ceTe.DynamicPDF.Rasterizer.RenderNativeWin32.a(IntPtr A_0, int A_1, IntPtr A_2, ref ulong A_3)

DllNotFoundException: Unable to load DLL 'DPDFRenderNative_x86': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
ceTe.DynamicPDF.Rasterizer.RenderNativeWin32.a(IntPtr A_0, int A_1, IntPtr A_2, ref ulong A_3)
ceTe.DynamicPDF.Rasterizer.RenderNativeWin32.ak(IntPtr A_0, int A_1, IntPtr A_2, ref ulong A_3)
ceTe.DynamicPDF.Rasterizer.PdfiumUtilityClass.a(IntPtr A_0, int A_1, IntPtr A_2, ref ulong A_3)
ceTe.DynamicPDF.Rasterizer.InputPdf..ctor(byte[] data)
Did some more digging This is all regarding the Nuget package v3.4.0.39186 by the way. I could be way off base with all this but I'm grasping at straws as to why this refuses to work after being deployed.

It seems that the assumption with errors like this, that one of the dependencies is missing. So I found out that the sysinternals Process Monitor tool can help track down the file(s) it is trying to access. That thing is a massive dump of information, but I was able to find out it's failing to find a dll called winfax.dll. I verified that it was the DPDFRenderNative file that was causing this by running the C++ tool dumpbin to view it's dependencies. and I got the following list

WINFAX.dll
gdiplus.dll
KERNEL32.dll
USER32.dll
GDI32.dll
WINSPOOL.DRV
ole32.dll

So while it seems like that's the cause, I'm not sure why that file is needed, or why it's missing from the server? Will that lack of this file prevent the rasterizer from working?

Ok, so against my better judgement, I coped the winfax.dll file from the c:\windows\system32\ folder on my windows 10 dev machine, into the application folder on the 2012 R2 server (since that's the the first place it looks according to process monitor), and the app works now. What the hell? Why is winfax.dll needed? And since it is obviously, where do I find it officially for a Microsoft OS rather than cannibalizing it from a different system, and why is it not listed as a requirement in the documentation?
I also tried to deploy to a brand new clean 2019 server install and ran into the exact same problem. Again, copying in the winfax.dll file fixed my problem.

What is the legitimate way to get this file into the system32 folder? Was it mistakenly added as a dependency with 3.4? Because I don't remember needing it before.
Posted by a ceTe Software moderator
Hi,

Thanks for reporting this issue and for all the details you provided. The winfax.dll should not be a dependency of DynamicPDF Rasterizer. We expect to release a fix for this tomorrow.

Thanks,
ceTe Software Support Team
Posted by a ceTe Software moderator
Hi,

The update has been posted to Nuget and our site. Please download v3.05 to resolve the issue.

Thanks again for all the details you provided on this issue. It helped us find and resolve the issue quickly.

Thanks,
ceTe Software Support Team
Thanks, this solved the initial problem.

I'm still trying to chase down some other problems but I'm not sure it's Rasterizer yet. Is the documentation for Rasterizer still accurate after these fixes?  Does the NET40 version of the library still not require the Visual C++ 2017 runtime?

I'm encountering problems trying get a very  basic Rasterizer test running in LinqPad as it's complaining "Unable to load DLL 'DPDFRenderNative_x64': The specified module could not be found. (Exception from HRESULT: 0x8007007E)".  Assuming this was a caveat of being unable to locate the file from the nuget package, I copied the native dll to the same folder as myLinqPad exe, but it still can't load the native DLL. So, I started retracing my steps from last time my steps from last time.

It seems like it's failing to find MSVCP140_APP.dll  (using ProcessMonitor) which I am guessing is from the Visual C ++ runtime 2017? Even though it appears to be loading "\lib\net40\DynamicPDF.Rasterizer.NETFramework40.dll", which the DynamicPdf documentation says doesn't need the runtime to be there? I do have the 2015-2019 redistributable installed, though when I search my C drive for  MSVCP140_APP.dll, there's nothing in the expected locations.

Doing the same dumpbin command from before on the DPDFRenderNative_x64 (or 86 for that matter) does list some dependents that seems to indicate that it wants the 2017 runtime (MSVCP140_APP.dll, VCRUNTIME140_APP.dll), even though  documentation  says it's not required? Or maybe the nuget package just isn't supported in LinqPad?
Posted by a ceTe Software moderator
Hello,

Yes, if your application is referencing the DynamicPDF.Rasterizer.NETFramework40.dll then there is no dependency on VC++ redistributables. If you are using DynamicPDF.Rasterizer.NETStandard20.dll then you will need to have the Visual C++ Redistributable for Visual Studio 2017 package installed on the target machine.
 
Try referencing the DLL locally from your system and let us know the results. Please download the product here. Then reference the DynamicPDF.Rasterizer.NETFramework40.dll and place both native DLL files alongside the DynamicPDF.Rasterizer.NETFramework40.dll file.
 
Thanks,
ceTe Software Support Team
Looks like my latter roadblock was a mistake on my part. However I did discover that LinqPad does not support *.target files, which is what the DynamicPDF Nuget package uses to copy the native DLLs. It looks like LinqPad uses Roslyn to do its compilation, not MSBuild. So no matter what I have to put the Native DLLs somewhere convenient for LinqPad to find in order to use DynamicPDF with it, regardless if my reference is via Nuget or the locally installed product.
Posted by a ceTe Software moderator - Commonly asked question
Hi,

Thanks for the update and information.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 12:06 PM.