public static async Task <LocalWorkService> Create(IDictionary <string, string> configuration) { var host = new LocalServiceHost( new NuGetStartOptions() { AppDescription = new ServiceHostDescription( new ServiceHostInstanceName( new ServiceHostName( new DatacenterName( new EnvironmentName( "nuget", "local"), 0), "work"), 0), Environment.MachineName), Configuration = configuration, Services = new[] { "LocalWork" } }); var name = new ServiceName(host.Description.InstanceName, ServiceDefinition.FromType <WorkService>().Name); host.Initialize(); if (!await host.Start()) { throw new InvalidOperationException(Strings.LocalWorker_FailedToStart); } return(host.GetInstance <LocalWorkService>()); }
void Container1() { string contextFileName; WorkflowRuntime workflowRuntime = new WorkflowRuntime(); LocalServiceHost localServiceHost = null; String contextFileExtension = null; //ChannelManagerService.ChannelManagerService(IList) //<snippet1> contextFileName = localServiceHost.Description.ServiceType.Name + contextFileExtension; // add local client endpoints workflowRuntime = this.Description.Behaviors.Find <WorkflowRuntimeBehavior>().WorkflowRuntime; workflowRuntime.AddService(new ChannelManagerService(localServiceHost.ClientEndpoints)); localServiceHost.Open(); //</snippet1> }
public LocalWorkflowServiceHost(Type workflowType, object localServiceInstance, params Uri[] baseAddress) : base(workflowType, baseAddress) { localServiceHost = new LocalServiceHost(localServiceInstance, baseAddress); }