diff --git a/src/OmniSharp/Dnx/DesignTimeHostManager.cs b/src/OmniSharp/Dnx/DesignTimeHostManager.cs index d982ccc047..a141a83de0 100644 --- a/src/OmniSharp/Dnx/DesignTimeHostManager.cs +++ b/src/OmniSharp/Dnx/DesignTimeHostManager.cs @@ -63,7 +63,7 @@ public void Start(string hostId, Action onConnected) using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { var t1 = DateTime.UtcNow; - var dthTimeout = TimeSpan.FromSeconds(4); + var dthTimeout = TimeSpan.FromSeconds(10); while (!socket.Connected && DateTime.UtcNow - t1 < dthTimeout) { Thread.Sleep(500); @@ -76,6 +76,13 @@ public void Start(string hostId, Action onConnected) // this happens when the DTH isn't listening yet } } + + if (!socket.Connected) + { + // reached timeout + _logger.LogError("Failed to launch DesignTimeHost in a timely fashion."); + return; + } } if (_designTimeHostProcess.HasExited) @@ -98,7 +105,7 @@ public void Start(string hostId, Action onConnected) onConnected(port); } } - + public void Stop() { lock (_processLock)