private ProcessDomain(string friendlyName, ProcessDomainSetup setupInfo)
 {
     _friendlyName      = friendlyName;
     _process           = new ActivatorProcess(friendlyName, setupInfo);
     _process.Attached += Process_Attached;
     _process.Detached += Process_Detached;
     _process.Start();
 }
        internal static void Serialize(ProcessDomainSetup setup, string filename)
        {
            var formatter = new BinaryFormatter();

            using (var fs = new FileStream(filename, FileMode.Create, FileAccess.Write))
            {
                formatter.Serialize(fs, setup);
            }
        }
 /// <summary>
 /// Creates a ProcessDomain which allows hosting objects and code out-of-process
 /// </summary>
 /// <param name="friendlyName">The friendly name of the process domain which directly will also be the file name of the remote process</param>
 /// <param name="setupInfo">Additional settings for creating the process domain</param>
 public static ProcessDomain CreateDomain(string friendlyName, ProcessDomainSetup setupInfo)
 {
     Logger.InfoFormat("Creating process domain '{0}'", friendlyName);
     return(new ProcessDomain(friendlyName, setupInfo));
 }