第 3 方程序集加载缓慢
我有一个命令行进程,可以使用 ABCpdf 从 HTML 文件创建 PDF 文件。我正在尝试从 v5(非常旧,不再支持)升级到 v8,但在安装 ABCpdf 8 并更新我的应用程序以使用新的 DLL 后,我注意到该过程过去只需要不到一秒钟的时间即可完成转换现在需要 20 多秒。
我在代码中添加了一些跟踪调用,看起来程序尝试引用 ABCpdf 8 DLL 中的对象的点是事情暂停很长一段时间的地方。一旦代码超过了这一点,它就会像以前一样快速运行。
我的问题是:在尝试引用第 3 方库时,什么可能导致 CLR 速度减慢这么多?我已验证 ABCpdf 8 DLL 位于 GAC 中,并且与可执行文件位于同一目录中。
提前致谢。
I have a command-line process that creates a PDF file from an HTML file using ABCpdf. I'm trying to upgrade from v5 (very old, no longer supported) to v8 but after installing ABCpdf 8 and updating my application to use the new DLL, I've noticed that the process which used to take less than a second to convert now takes 20+ seconds.
I've added some trace calls in the code and it appears that the point where the program attempts to reference an object from the ABCpdf 8 DLL is where things pause for a good long while. Once the code gets past that point it runs as fast as ever.
The question I have is: What could cause the CLR to slow down so much when attempting to reference a 3rd party library? I've verified that the ABCpdf 8 DLL is in the GAC as well as the same directory as the executable.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
让我大胆猜测一下:
您正在一台没有(传出)互联网连接的服务器上运行它。
该组件具有强名称并使用加密密钥进行签名。正在检查证书(吊销列表检查证书是否仍然有效且受信任)。由于没有互联网连接而超时。
如果您想确认这一点,请附加一个调试器(WinDbg?)并在任何线程上确认以下堆栈跟踪:
有一个针对 Windows 服务器版本的 Service Pack 版本通过默认启用检查来破坏此问题。您可以使用注册表设置禁用它。
请参阅 ASP. NET Hang:Authenticode 签名的程序集:
哦,该页面没有(明确)链接到解决方案:
元素Out on a limb, let me guess:
You are running this on a server without (outgoing) internet connectivity.
The component is strongnamed and signed with a cryptographic key. The certificate is being checked (the revocation list is checked whether the certificate is still valid and trusted). This times out due the absense of an internet connection.
If you want to confirm this, attach a debugger (WinDbg?) and confirm the following stacktrace on any of the threads:
There has been a Service Pack release for Windows server editions that broke this by defaulting to have the check enabled. You can disable it using a registry setting.
See ASP.NET Hang: Authenticode signed assemblies:
Oh, that page didn't (clearly) link to the solution:
<generatePublisherEvidence>
Element如果是密码问题,您可以使用以下 app.config 条目来解决。
但据我所知,如果计算机有 DNS,但没有其他可用的互联网连接(防火墙),这只是一个问题。
If it is the cryptograpic issue, you can solve it by using the followng app.config entry.
But afaik this is only an issue if the computer has dns, but no other internet connection available(firewall).
我遇到了一个非常相似的问题,即使用 Gecko 引擎时,创建第一个 PDF 需要 45 秒。一旦开始就ok了。
导致该问题的原因是我们的产品服务器没有传出连接。要修复此问题,可以更改组策略设置以将超时设置为 1 秒。请参阅:
http://technet.microsoft.com/en-us/library/cc753863 .aspx
了解如何执行此操作的步骤。
I had a very similar problem which was when using the Gecko engine it would take 45 seconds to create the first PDF. Once started it was ok.
The issue was being caused because our prod server had no outgoing connectivity. To fix it there is a group policy setting that can be changed to set the timeout to 1 second. See:
http://technet.microsoft.com/en-us/library/cc753863.aspx
for steps on how to do this.