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; }
void OnDomainUnload(object sender, EventArgs e) { _ad = null; _host = null; }
public ServiceHostManager() { _host = new ServiceHost(); }