24 ArgumentNullException.ThrowIfNull(platformIdentifier);
25 ArgumentNullException.ThrowIfNull(ioManager);
27 var dotnetPaths = Common.DotnetHelper.GetPotentialDotnetPaths(platformIdentifier.
IsWindows)
29 var tasks = dotnetPaths
30 .Select(path => ioManager.
FileExists(path, cancellationToken))
33 await Task.WhenAll(tasks);
35 var selectedPathIndex = tasks.FindIndex(pathValidTask => pathValidTask.Result);
37 if (selectedPathIndex == -1)
40 var dotnetPath = dotnetPaths[selectedPathIndex];