views:

156

answers:

1

We use MapInfo MapX mapping engine in our ASP.NET application. After server (Windows Server 2003 SP2) reinstallation we encountered a strange problem - web app hangs when accessing ActiveX instance.

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.

I think the problem is related to COM and ASP.NET, because the application worked fine before server reinstallation.

A: 

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. I noticed that the w3wp.exe process stops when trying to read something from the Windows registry:HKEY_CLASSES_ROOT->CLSID->{xxx-xxx...}. Opened regedit - well, this node holds some info about MapX.

After 'READ' premission to this node was added to the Network Service account (w3wp is running on this) application started working fine.

Tadas