コード例 #1
0
        private void CreateNewAppDomain()
        {
            var ads = GetDomainSetupInformation();

            var evidence = new Evidence(AppDomain.CurrentDomain.Evidence);

            _ad = AppDomain.CreateDomain("BankReport #1", evidence, ads);

            _ad.DomainUnload += OnDomainUnload;

            Type tp = typeof(ServiceHost);

            _host = _ad.CreateInstanceAndUnwrap(tp.Assembly.FullName, tp.FullName) as ServiceHost;
        }
コード例 #2
0
 void OnDomainUnload(object sender, EventArgs e)
 {
     _ad = null;
     _host = null;
 }
コード例 #3
0
 public ServiceHostManager()
 {
     _host = new ServiceHost();
 }