Exception RPC_E_SERVERFAULT(0x80010105) : While adding ArcGIS Map Service through TCP

10260
11
05-08-2013 04:05 AM
prashantk
New Contributor III
Hi all,

I am trying to add ArcGIS Map Service into ArcDesktop.I have implemented the code on ESRI command and is working fine.
Same code is not working on below scenarios,

1. Receiving data through TCP duplex communication channel(Policy server) and on message receive event,execute the add layer code..
2. Receiving data from clipbard.

On both cases i am removing manual button click event to add data.

Processing of data starts on event raised from TCP or Clipbord in Arcmap environment(C# Arcobject).

System is throwing com exception in below step.

 map.AddLayer(layer); 

Error ...
ESRI.ArcGIS.Carto 
Message = "The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"


Any help would be appreciated,

Thanks,
Prashant
0 Kudos
11 Replies
prashantk
New Contributor III
Thanks Richard for your quick reply.

I will let you know asap.

Thanks again,
Prashant.
0 Kudos
prashantk
New Contributor III
Hi Richard,

Thanks for your valuable suggestions.Finally i got the solution to resolve this issue.

As discuss,invoked method on main thread using

this.Invoke((MethodInvoker)delegate { MethodName(); });


Before invoking method,Thread state was MTA and After invoke : COM STA and code starts working.

Thanks again,
Prashant.
0 Kudos