pruiz / WkHtmlToXSharp

C# wrapper wrapper (using P/Invoke) for the excelent Html to PDF conversion library wkhtmltopdf library.
239 stars 84 forks source link

Running this library under IIS7 & ASP.NET 4.0 #10

Closed axerosolutions closed 8 years ago

axerosolutions commented 12 years ago

Hi,

I read in an earlier issue that running this lib under IIS is not supported. What does this imply? I would like to use this library, and get rid of AbcPdf in my ASP.NET 4.0 project. Is it possible? I do not want to use any web service or windows service.

Can I use it on a 64bit OS with IIS7 app pool set to 32-bit? If yes (as per your readme) then why did you mention here that IIS is not supported: https://github.com/pruiz/WkHtmlToXSharp/issues/8#issuecomment-7548939

Thank you,

Vivek

pruiz commented 12 years ago

IIS instantiates & re-cycles pools and AppDomains from time to time, and this causes non-managed resources used by this library to not being released properly.

Pablo

On Sun, Aug 26, 2012 at 12:28 AM, VIvek Thakur notifications@github.comwrote:

Hi,

I read in an earlier issue that running this lib under IIS is not supported. What does this imply? I would like to use this library, and get rid of AbcPdf in my ASP.NET 4.0 project. Is it possible? I do not want to use any web service or windows service.

Can I use it on a 64bit OS with IIS7 app pool set to 32-bit? If yes (as per your readme) then why did you mention here that IIS is not supported: https://github.com/pruiz/WkHtmlToXSharp/issues/8#issuecomment-7548939

Thank you,

Vivek

— Reply to this email directly or view it on GitHubhttps://github.com/pruiz/WkHtmlToXSharp/issues/10.

axerosolutions commented 12 years ago

Hi Pablo,

Thank you for your reply.

What if we dispose these objects in the Application_End()? Is it not possible?

-Vivek

pruiz commented 8 years ago

Running this library under ASP.NET (or more specifically IIS) is not supported. This has to do with the way IIS manages underlaying threads, and application pools.

What most people do (myself included) is to create a daemon or windows service which handles requests from the ASP.NET/MVC/etc. process via any form of RPC or queuing.

Regards

liguobao commented 8 years ago

Why IIS will recycle the WkHtmlToXSharp memory?

I can‘t understand it.

Regards

pruiz commented 8 years ago

Try googling about it: https://www.outsystems.com/forums/discussion/10307/understanding-application-pool-recycling-and-how-to-fine-tune-for-use-with-outsys/

liguobao commented 8 years ago

Thanks.

liguobao commented 8 years ago

If the binary throw exception: “Attempted to read or write protected memory. This is often an indication that other memory is corrupt.” in IIS,we should restart the app to recycle bad memory?

Thanks for your reply.