[英]Getting 0x80070002 error intermittently when trying to instantiate a COM object in classic ASP
We have a classic ASP page that is instantiating a .Net object through a COM interface. 我们有一个经典的ASP页面,该页面通过COM接口实例化.Net对象。 It was working fine for a long time, but over the weekend we applied some Windows updates and it is no longer working reliably in our production environment.
长期以来,它运行良好,但是在周末我们应用了Windows更新,因此在生产环境中不再可靠运行。 Sometimes it works, sometimes it doesn't and it seems random when it works.
有时它起作用,有时却不起作用,并且似乎起作用时是随机的。 It doesn't fail in a test environment or even on the production servers when we take them out of the cluster (seems to only fail under load).
当我们将它们从群集中移出时,它在测试环境甚至生产服务器上都不会失败(似乎只能在负载下失败)。
The error is "-2147024894 - File or assembly name FusionEngine, or one of its dependencies, was not found." 错误为“ -2147024894-找不到文件或程序集名称FusionEngine或其依赖项之一”。 The number converted to hex is 80070002.
转换为十六进制的数字是80070002。
We created a test page that is pretty basic. 我们创建了一个非常基本的测试页面。 It basically just instantiates the object and calls a simple property on it to display.
它基本上只是实例化该对象并在其上调用一个简单的属性以进行显示。
<%
On Error Resume Next
set oFusion = Server.CreateObject("Fusion.Engine")
%>
Error: <%=err.Number%> - <%=err.Description%><br>
[<%=oFusion.DPI%>]<br>
We tried recreating the object if an error was detected (10 times with a 1 second interval) but if it doesn't work once, it doesn't work 10 times either. 如果检测到错误(以1秒为间隔的10次),我们尝试重新创建对象,但是如果一次都不起作用,则也不会重复10次。
The fusion object is very simple. 融合对象非常简单。 It only references System.dll and System.Drawing.dll (it generates images).
它仅引用System.dll和System.Drawing.dll(它生成图像)。
The problem turned out to be that we were running two different versions of .Net (1.1 and 2.0). 问题出在我们运行的是两个不同版本的.Net(1.1和2.0)。 We were able to get it to work by making sure that they were running under different application pools.
通过确保它们在不同的应用程序池下运行,我们能够使其正常运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.