Ejemplo n.º 1
0
 private void CreateAppDomain()
 {
     try
     {
         appDomain = AppDomainUtils.CreateAppDomain(@"IsolatedAppDomainHost",
                                                    HostSetup.ApplicationBaseDirectory, temporaryConfigurationFilePath, HostSetup.ShadowCopy);
     }
     catch (Exception ex)
     {
         throw new HostException("Could not create the isolated AppDomain.", ex);
     }
 }
Ejemplo n.º 2
0
        /// <inheritdoc />
        protected override IRemoteHostService AcquireRemoteHostService()
        {
            try
            {
                SetWorkingDirectory();
                CreateTemporaryConfigurationFile();
                CreateAppDomain();
                AttachDebuggerIfNeeded(debuggerManager, Process.GetCurrentProcess());

                var endpoint = (IsolatedAppDomainEndpoint)AppDomainUtils.CreateRemoteInstance(appDomain, typeof(IsolatedAppDomainEndpoint));

                foreach (string hintDirectory in HostSetup.HintDirectories)
                {
                    endpoint.AddHintDirectory(hintDirectory);
                }

                return(endpoint.CreateRemoteHostService(null));
            }
            catch (Exception)
            {
                FreeResources();
                throw;
            }
        }