public server_context() { SelectPort(); _http = new AppDomainHost <ConfigurationExecutorHost>(new[] { "http://+:" + _port + "/" }, "/", null); _http.Initialize(); }
public server_context() { SelectPort(); _http = new AppDomainHost<ConfigurationExecutorHost>(new[] { "http://+:" + _port + "/" }, "/",null); _http.Initialize(); }
public void tear() { try { if (_http != null) { _http.StopListening(); _http = null; } } catch (AppDomainUnloadedException) { } }
public void tear() { try { if (_http != null) { _http.StopListening(); _http = null; } } catch(AppDomainUnloadedException){} }
private static void RunAgents() { //Autofac.ContainerBuilder builder = new ContainerBuilder(); AgentCatalogBuilder agentCatalogBuilder = new AgentCatalogBuilder(); string agentUid = "SampleValidService.Agent.SampleService"; //get assembly SampleValidService.Agent.dll //activate SampleValidService.Agent.SampleService class instance //read config from SampleValidService.Agent.dll.config //create service host from instance // open host Type[] agentTypes = agentCatalogBuilder.GetAgentTypes(); foreach (Type agentType in agentTypes) { var configName = GetAgentConfigName(agentType) + ".config"; var config = GetConfigSource(configName); var appSettingsSection = config.GetSection("appSettings") as AppSettingsSection; var address = new Uri(appSettingsSection.Settings["address"].Value); AppDomainHost appDomainHost = AppDomainHost.CreateConfigured(agentType, address); appDomainHost.Open(); } //publiserServiceHost.AddServiceEndpoint() }