diff --git a/src/Ionide.ProjInfo/Library.fs b/src/Ionide.ProjInfo/Library.fs index 0f3047ea..cddc07cc 100644 --- a/src/Ionide.ProjInfo/Library.fs +++ b/src/Ionide.ProjInfo/Library.fs @@ -31,13 +31,18 @@ module SdkDiscovery = info.ArgumentList.Add arg info.RedirectStandardOutput <- true - let p = System.Diagnostics.Process.Start(info) + use p = System.Diagnostics.Process.Start(info) + + let output = + seq { + while not p.StandardOutput.EndOfStream do + yield p.StandardOutput.ReadLine() + } + |> Seq.toArray + p.WaitForExit() + output - seq { - while not p.StandardOutput.EndOfStream do - yield p.StandardOutput.ReadLine() - } let private (|SemVer|_|) version = match SemanticVersioning.Version.TryParse version with