ABCpdfCE7.dll 被 IIS 锁定
我在 ASP.Net 中有一个网站,它使用名为 ABCPdf 的第三方应用程序生成 PDF。 ABCPdf 由两个 dll 组成:ABCpdf.dll 和 ABCpdfCE7.dll。 ABCpdf.dll 是非托管 ABCpdfCE7.dll 的 .NET 包装器。
pdf 生成后。 ABCpdfCE7.dll 被 IIS 锁定(即无法重命名或删除它),除非我回收应用程序池或重新启动 IIS。这会在更新我的网站时导致问题,因为我们无法覆盖 ABCpdfCE7.dll。
无论如何,有没有办法释放在 .Net 中锁定 ABCpdfCE7.dll 的资源?在每次更新时重新启动 IIS 或回收应用程序池并不是一个解决方案,因为我有多个网站在其上运行。
我每次都会处理 PDF 库中的对象
Using theDoc As New Doc
// Generate the pdf
theDoc.Clear()
End Using
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ABCpdfCE7.dll 多久更改一次?我想不会太频繁,所以为什么你每次更新都要推送它,就把它忽略掉吧。
另外,还有一些观察结果:
回收应用程序池会保留会话,因此如果您缓存大量昂贵的资源,那么除了性能之外,它不应该对您的用户产生任何影响,并且有人会遇到首次点击延迟。
ABCPdf 根据您的使用方式,会生成一个 Internet Explorer 实例来将 HTML 呈现为 PDF。您可以检查任务管理器以查看 IE 是否在后台运行,如果是,则杀死它可以解决您的问题,尽管我不知道如何避免可能杀死某人的 PDF 作业。
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.