title: With .Net Remoting is there any way to modify the remote object before making it accessible?
body: <p>I have two processes that are communicating via <code>.Net remoting</code>, process <code>A</code> and <code>B</code>. I want that process <code>A</code> modifies a <code>List</code> and than send it to process <code>B</code>.</p>
  
  <p>I have the following code (both processes share the same code):</p>
  
  <pre><code>namespace MyProcess
  {
      class Program
      {       
          static void Main(string[] args)
          {
              //Process A modifies List
              if(process A){
                  changeList();
                  createOutputList();
              }
              //Process B gets the List 
              if(process B){
                  OutputListObject op = retrieveOutputList();
                  op.getList();
              }           
              Console.ReadKey();
          }
  
          void changeList()
          {
              //Some modification
          }
  
          OutputListObject retrieveOutput()
          {
              TcpChannel channel = new TcpChannel();
              ChannelServices.RegisterChannel(channel, false);
  
              OutputListObject op = (OutputListObject)Activator.GetObject(
                  typeof(OutputListObject),
                  "tcp://localhost:10001/MyRemoteOperator");
  
              return op;
          }
  
          void createOutput()
          {
              TcpChannel channel = new TcpChannel(10001);
              ChannelServices.RegisterChannel(channel, false);
  
              RemotingConfiguration.RegisterWellKnownServiceType(
                  typeof(OutputListObject),
                  "OutputList",
                  WellKnownObjectMode.Singleton);
          }
  
      }
  
      public class OutputListObject : MarshalByRefObject
      {
          public List&lt;String&gt; getList()
          {
              //return the modified list by Process A
          }
      }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>