DinkToPdf icon indicating copy to clipboard operation
DinkToPdf copied to clipboard

Azure web app not working as expected??

Open MacMcDell opened this issue 5 years ago • 8 comments

Hi. I cannot seem to get the correct configuration for getting this to work on an azure web app. The web app is configured to run under 64bit and the library I am using is the 64 bit one. It works flawlessly on my local through localhost. I have included the the three libwkhtmltox files needing to be present in the root of the directory where startup.cs is located. I have done that. From Kudu I can see this.... image

my appsettings in my web app are this: image

my vs .net core website looks like this image

My error is this image

AggregateException: One or more errors occurred. (An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)) DinkToPdf.SynchronizedConverter.Invoke<TResult>(Func<TResult> delegate) DinkToPdf.SynchronizedConverter.Convert(IDocument document)

Any advice would be totally appreciated.

MacMcDell avatar Aug 24 '18 19:08 MacMcDell

I got the same issue , works find on local but below error if deploy to Azure web. (using 64 bit dll) System.BadImageFormatException: An attempt was made to load a program with an incorrect format.

Any chance you got this solved ?

tidusong avatar Sep 12 '18 01:09 tidusong

I also have this issue. Does someone have an answer?

MRauca avatar Sep 12 '18 10:09 MRauca

I got this solved by change to 32 bit dll

tidusong avatar Sep 12 '18 23:09 tidusong

If Azure platform is 32 bit appservice, then it works fine if we use 32 bit dll.

rajapc avatar Sep 18 '18 13:09 rajapc

I also have the same problem, tried both 32 and 64 bit version, nothing seems to be working...

aleksa-kuzman avatar Feb 19 '20 16:02 aleksa-kuzman

I got this solved by change to 32 bit dll

Hi @tidusong, I have the same issue. If I change platform to 32 bit(x86) and build it, I can't run it locally. Could you provide your steps? Thank you very much.

JasonYangNWI avatar Sep 24 '20 00:09 JasonYangNWI

If Azure platform is 32 bit appservice, then it works fine if we use 32 bit dll.

Hi @rajapc , do I need change local platform to x86 as well? Thanks.

JasonYangNWI avatar Sep 24 '20 00:09 JasonYangNWI

Hey guys does anyone have any updates on this? I'm experiencing the same issue. On my local the 64bit library works, however in Azure only the 32bit works. Experiencing the same error as above:

An attempt was made to load a program with an incorrect format.

Does anyone have any thoughts on a way to include both libraries and have the function work out which it requires? Cheers!

jimmytricks avatar Aug 23 '21 15:08 jimmytricks