public void Start(string connectionString, string applicationName) { try { domain = AppDomain.CreateDomain("ServerDomain"); starter = (WorkflowServerStarter)domain.CreateInstanceAndUnwrap( System.Reflection.Assembly.GetEntryAssembly().FullName, typeof(WorkflowServerStarter).FullName + ""); starter.Start_(connectionString, applicationName); starter.OnCustomHandleException_ += starter_OnCustomHandleException_; } catch (Exception e) { Tracing.Tracer.LogError(e); if (OnCustomHandleException != null) { OnCustomHandleException(null, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Message)); } } }
public void Start<TModuleProvider>(string connectionString, string applicationName) where TModuleProvider:ModuleBase{ try { _domain = AppDomain.CreateDomain("Server"); _starter = (WorkflowServerStarter)_domain.CreateInstanceAndUnwrap( Assembly.GetEntryAssembly().FullName, GetType().FullName ?? throw new InvalidOperationException()); _starter.OnServerDomainCustomHandleException += StarterOnOnServerDomainCustomHandleException; var workflowServerEventArgs = new WorkflowServerEventArgs(); OnWorkflowServerRequested(workflowServerEventArgs); _starter.StartOnServerDomain<TModuleProvider>(connectionString, applicationName); } catch (Exception e) { Tracing.Tracer.LogError(e); OnCustomHandleException?.Invoke(null, new ExceptionEventArgs("Exception occurs:\r\n\r\n" + e.Message)); } }