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))"