Search code examples
.netunmanagedabcpdf

ABCpdfCE7.dll locked by IIS


I have a website in ASP.Net that generates PDF with a 3rd party application called ABCPdf. ABCPdf consists of two dll : ABCpdf.dll and ABCpdfCE7.dll. ABCpdf.dll is a .NET wrapper for the unmanaged ABCpdfCE7.dll.

As soon as a pdf is generated. the ABCpdfCE7.dll is locked by IIS (i.e. cannot rename it or delete it) uneless I recycle the application pool or restart IIS. This cause problem when updating my website because we cannot overwrite ABCpdfCE7.dll.

Is there anyway to release the resource that is locking ABCpdfCE7.dll in .Net ? Restarting IIS or recycle the application pool at each update is not a solution because I have multiple websites running on it.

I'm disposing the object from the PDF library everytime

Using theDoc As New Doc

    // Generate the pdf

    theDoc.Clear()
End Using

Solution

  • How often does ABCpdfCE7.dll change? I imagine not too often, so why are you pushing it with each update, just leave it out.

    Plus, just a couple more observations:

    Recycling the App Pool preserves sessions, so it shouldn't have any impact on your users, other than performance if your are caching a lot of expensive resources, and someone will get a first-hit delay.

    ABCPdf, depending on how you're using it, spawns an instance of Internet Explorer to render HTML to PDF. You might check the the task manager to see if IE is running in the background, and if so, killing it could solve your problems, although I don't know how you would avoid possibly killing someone's PDF job.