Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mcs / class / corlib / System.Runtime.Remoting.Proxies / RealProxy.cs
index 745c16134451013c22fa87c1e42c13a3a43e0f53..de4b921cff8671dd29568107d49ca017960ae6a6 100644 (file)
@@ -41,6 +41,7 @@ using System.Runtime.Remoting.Contexts;
 using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Runtime.InteropServices;
+using System.Threading;
 
 namespace System.Runtime.Remoting.Proxies
 {
@@ -162,7 +163,7 @@ namespace System.Runtime.Remoting.Proxies
                                                      out object [] out_args)
                {
                        MonoMethodMessage mMsg = (MonoMethodMessage) msg;
-                       mMsg.LogicalCallContext = CallContext.CreateLogicalCallContext (true);
+                       mMsg.LogicalCallContext = Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext;
                        CallType call_type = mMsg.CallType;
                        bool is_remproxy = (rp is RemotingProxy);
 
@@ -217,8 +218,9 @@ namespace System.Runtime.Remoting.Proxies
                                }
                        }
                        
-                       if (res_msg.LogicalCallContext != null && res_msg.LogicalCallContext.HasInfo)
-                               CallContext.UpdateCurrentCallContext (res_msg.LogicalCallContext);
+                       if (res_msg.LogicalCallContext != null && res_msg.LogicalCallContext.HasInfo) {
+                               Thread.CurrentThread.GetMutableExecutionContext().LogicalCallContext.Merge (res_msg.LogicalCallContext);
+                       }
 
                        exc = res_msg.Exception;