简体   繁体   English

访问ActiveX组件时ASP.NET应用程序挂起

[英]ASP.NET app hangs when accessing ActiveX component

We use MapInfo MapX mapping engine in our ASP.NET application. 我们在ASP.NET应用程序中使用MapInfo MapX映射引擎。 After server (Windows Server 2003 SP2) reinstallation we encountered a strange problem - web app hangs when accessing ActiveX instance. 重新安装服务器(Windows Server 2003 SP2)后,我们遇到了一个奇怪的问题-访问ActiveX实例时Web应用程序挂起。

For example: 例如:

 
MapXLib.Map _mapXMap =
    (MapXLib.Map)HttpContext.Current.Server.CreateObject("MapX.Map.5");
_mapXMap.MapUnit = MapXLib.MapUnitConstants.miUnitKilometer; // application hangs here

However, the code 但是,代码


MapXLib.Map _mapXMap =
    (MapXLib.Map)Activator.CreateInstance(Type.GetTypeFromProgID("MapX.Map.5"));
_mapXMap.MapUnit = MapXLib.MapUnitConstants.miUnitKilometer;

works fine within a standard windows application. 在标准Windows应用程序中可以正常工作。

I think the problem is related to COM and ASP.NET, because the application worked fine before server reinstallation. 我认为问题与COM和ASP.NET有关,因为在重新安装服务器之前应用程序运行良好。

The problem is resolved. 问题已解决。 Maybe this will be helpful for somebody. 也许这对某人会有帮助。

So, I ran Process Monitor (sysinternals) and captured all the events from w3wp.exe when my application is running. 因此,我运行了进程监视器(sysinternals),并在我的应用程序运行时捕获了来自w3wp.exe的所有事件。 I noticed that the w3wp.exe process stops when trying to read something from the Windows registry:HKEY_CLASSES_ROOT->CLSID->{xxx-xxx...}. 我注意到当尝试从Windows注册表中读取某些内容时,w3wp.exe进程停止了:HKEY_CLASSES_ROOT-> CLSID-> {xxx-xxx ...}。 Opened regedit - well, this node holds some info about MapX. 打开regedit-好吧,此节点包含有关MapX的一些信息。

After 'READ' premission to this node was added to the Network Service account (w3wp is running on this) application started working fine. 将对该节点的“读取”权限添加到网络服务帐户(此服务器上正在运行w3wp)后,应用程序开始正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM