DinkToPdf icon indicating copy to clipboard operation
DinkToPdf copied to clipboard

[NO ISSUE] "Library was NOT tested with IIS" -> It works !

Open TomyCesaille opened this issue 7 years ago • 17 comments

Hello, I noticed the "Library was NOT tested with IIS." in README.

For the record, the package works under IIS.

  • Package 1.0.8 with libwkhtmltox.dll v0.12.4
  • IIS Version 8.5.9600.16384
  • Project is almost a raw ASP.NET CORE 2.1 API template, targeting core
  • Published as self contained
  • I had to use the CustomAssemblyLoadContext issue resolution here

Regards,

TomyCesaille avatar Aug 30 '18 07:08 TomyCesaille

Yes, I did a test right now and works fine.

lkolodziey avatar Sep 03 '18 19:09 lkolodziey

What did you do to get this working? I am not having any luck getting this running in IIS. I get the error Qt: Could not initialize OLE (error 80010106)

codingbadger avatar Sep 11 '18 12:09 codingbadger

@codingbadger, did you copied the libwkhtmltox.dll to the folder containing your solution dlls? I did that mistake (I didn´t copy it) and the same error appears to me.

lkolodziey avatar Sep 11 '18 15:09 lkolodziey

Hi @lkolodziey yes I have done that. It is loading the dll correctly because if I put the 64bit version in, the app crashes with a Bad Image Exception.

codingbadger avatar Sep 11 '18 15:09 codingbadger

@codingbadger, try to put all related files like attached image and try again. capture Let´s testing :D Does not matter if you using windows put all files ...

lkolodziey avatar Sep 11 '18 15:09 lkolodziey

Yep - I have all those files :)

codingbadger avatar Sep 11 '18 15:09 codingbadger

It is so strange. OK, Is your application running in IIS with "no managed code" (application pool) ? I your application 64bit configured in IIS (application pool) ?

lkolodziey avatar Sep 11 '18 15:09 lkolodziey

Yes - App pool is running as "no managed code". The "enable 32 bit applications" is set to False

codingbadger avatar Sep 11 '18 16:09 codingbadger

I finally got to the bottom of this, it turns out the the absolute url being used for images, css etc wasn't accessible from the webserver. Once this was fixed the PDF's were generated fine.

Thanks for your help @lkolodziey

codingbadger avatar Sep 12 '18 08:09 codingbadger

Basically broken links, good thing that solved. You are welcome.

lkolodziey avatar Sep 12 '18 15:09 lkolodziey

For all ... I created an example of use: https://github.com/lkolodziey/UsingDinkToPdf_Example

lkolodziey avatar Sep 14 '18 13:09 lkolodziey

Hello, @lkolodziey . Thank you for your sharing, I need your help, because libwkthmltox.dll is not running well in my IIS environment. I use libwkhtmltox.dll version 0.12.4 for .Net Core 2.0, and I published to IIS version 10.0.14393.0.

I got something error in my browser:

`An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately. C:\inetpub\wwwroot\prisma\Views\Home\Index.cshtml

Metadata file 'C:\inetpub\wwwroot\prisma\libwkhtmltox.dll' could not be opened -- PE image doesn't contain managed metadata. @{`

Could you share your knowledge about this? I really appreciate your help! Thanks!

novidaws avatar Mar 11 '19 06:03 novidaws

Hi All,

Can i use DinkToPdf with dot net core 2.1?.

I have used it with Asp.net core. it's working on local IIS but not working on Live Server.

Error : Unable to load DLL 'C:\inetpub\wwwroot\myproject\api\bin\libwkhtmltox.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E) Unable to load DLL 'C:\inetpub\wwwroot\myproject\api\bin\libwkhtmltox.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E).

Please let me know ASAP.

Thanks & Regards, Ranjeet

rajputranjeet569 avatar Jan 06 '20 13:01 rajputranjeet569

Yes you can. Performance of IIS is very bad. Imagine, at first server got 100 request concurrently, which every request will create 1 pdf file. If there is request 101th, it have to wait until 100 request finish.

casaulenbo avatar Feb 18 '20 15:02 casaulenbo

Hello, I'm from Brazil and I saw that this post is a little bit like my problem. my application returns the following result: "A#Could not load file or assembly 'DinkToPdf, Version=1.0.8.0, Culture=neutral, PublicKeyToken=null'" have you seen something like that? thanks for listening!

raissahonorato avatar Apr 24 '20 00:04 raissahonorato

Have you try this before? https://github.com/rdvojmoc/DinkToPdf/issues/5#issuecomment-321183899

casaulenbo avatar Apr 24 '20 01:04 casaulenbo