예제 #1
0
            public IsolatedHostHandle(AppDomainIsolatedHost <T> isolation, IDisposable handle)
            {
                if (isolation == null)
                {
                    throw new ArgumentNullException(nameof(isolation));
                }
                if (handle == null)
                {
                    throw new ArgumentNullException(nameof(handle));
                }

                this.isolation = isolation;
                this.handle    = handle;
            }
예제 #2
0
        public static IDisposable StartHost(string hostName, string applicationBase, string applicationConfig)
        {
            try
            {
                var hostIsolation = new AppDomainIsolatedHost <T>(applicationBase, applicationConfig, hostName);
                var hostHandle    = hostIsolation.Start();

                return(new IsolatedHostHandle(hostIsolation, hostHandle));
            }
            catch (Exception ex)
            {
                var error = ex.ToString();
                Trace.TraceError($"Failed to start AppDomainIsolatedHost: {error}");
                throw;
            }
        }