Ejemplo n.º 1
0
 private void SwitchServiceAndDomain()
 {
     _currentDomain  = _nextDomain;
     _currentService = _nextService;
     _nextDomain     = null;
     _nextService    = null;
 }
Ejemplo n.º 2
0
        private void Load(string librariesDirectory, string targetDirectory, State state = null)
        {
            if (librariesDirectory != targetDirectory)
            {
                DirectoryCopyAndOverwrite(librariesDirectory, targetDirectory);
            }
            EmptyStagingFolder();
            ConfigurationManager.RefreshSection("appSettings");
            RefreshAdditionalConfigurationSections();
            _nextDomain = AppDomain.CreateDomain("Ad2", null, _info);
            RemoteFactory factory = _nextDomain.CreateInstanceAndUnwrap("Connector", "Connector.RemoteFactory") as RemoteFactory;

            _nextService = factory.Create(targetDirectory, _dllName, _className);
            _folders.Swap();
            _nextService.SetState(state);
            _nextService.Start();
        }
Ejemplo n.º 3
0
 private void Unload()
 {
     _currentService.Stop();
     _currentService = null;
     AppDomain.Unload(_currentDomain);
 }