title: How can I communicate between plugins?
body: <p>I have a plugin system where I use <code>MarshalByRefObject</code> to create isolated domains per plugin, so users can reload their new versions, as they see fit without having to turn off the main application.</p>
  <p>Now I have the need to allow a plugin to view which plugins are currently running and perhaps start/stop a specific plugin.</p>
  <p>I know how to issue commands from the wrapper, in the below code for example:</p>
  <pre><code>using System;
  using System.Linq;
  using System.Reflection;
  using System.Security.Permissions;
  
  namespace Wrapper
  {
      public class RemoteLoader : MarshalByRefObject
      {
          private Assembly _pluginAassembly;
          private object _instance;
          private string _name;
  
          public RemoteLoader(string assemblyName)
          {
              _name = assemblyName;
              if (_pluginAassembly == null)
              {
                  _pluginAassembly = AppDomain.CurrentDomain.Load(assemblyName);
              }
  
              // Required to identify the types when obfuscated
              Type[] types;
              try
              {
                  types = _pluginAassembly.GetTypes();
              }
              catch (ReflectionTypeLoadException e)
              {
                  types = e.Types.Where(t =&gt; t != null).ToArray();
              }
  
              var type = types.FirstOrDefault(type =&gt; type.GetInterface(&quot;IPlugin&quot;) != null);
              if (type != null &amp;&amp; _instance == null)
              {
                  _instance = Activator.CreateInstance(type, null, null);
              }
          }
      
          public void Start()
          {
              if (_instance == null)
              {
                  return;
              }
              ((IPlugin)_instance).OnStart();
          }
  
          public void Stop()
          {
              if (_instance == null)
              {
                  return;
              }
              ((IPlugin)_instance).OnStop(close);
          }
      }
  }
  </code></pre>
  <p>So then I could, for example:</p>
  <pre><code>var domain = AppDomain.CreateDomain(Name, null, AppSetup);
  var assemblyPath = Assembly.GetExecutingAssembly().Location;
  var loader = (RemoteLoader)Domain.CreateInstanceFromAndUnwrap(assemblyPath, typeof(RemoteLoader).FullName);
  loader.Start();
  </code></pre>
  <p>Of course the above is just a resumed sample...</p>
  <p>Then on my wrapper I have methods like:</p>
  <pre><code>bool Start(string name);
  bool Stop(string name);
  </code></pre>
  <p>Which basically is a wrapper to issue the Start/Stop of a specific plugin from the list and a list to keep track of running plugins:</p>
  <pre><code>List&lt;Plugin&gt; Plugins
  </code></pre>
  <p>Plugin is just a simple class that holds <code>Domain</code>, <code>RemoteLoader</code> information, etc.</p>
  <p>What I don't understand is, how to achieve the below, from inside a plugin. Be able to:</p>
  <ul>
  <li>View the list of running plugins</li>
  <li>Execute the Start or Stop for a specific plugin</li>
  </ul>
  <p>Or if this is even possible with <code>MarshalByRefObject</code> given the plugins are isolated or I would have to open a different communication route to achieve this?</p>
  <h1>For the bounty I am looking for a working verifiable example of the above described...</h1>