private static Task <bool> StartSever(IBuildEngine buildEngine) { var router = new DefaultTargetSelector(); var host = new MSBuildHostService(buildEngine); var result = host.ServerTask; router.Register <IMsBuildHostService, MSBuildHostService>(host); var tcpHost = new TcpHost(new Engine().CreateRequestHandler(router)); result.ContinueWith(_ => { tcpHost.StopListening(); }); tcpHost.StartListening(new System.Net.IPEndPoint(IPAddress.Loopback, 9000)); Console.WriteLine("AvalonStudio MSBuild Host Started:"); return(result); }