You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| None -> failwithf $"Unable to get sdk versions at least from the string '{dotnetSdkVersionAtPath}'. This found sdks were {sdks |> Array.toList}"
138
190
| Error (dotnetExe, args, cwd, erroringVersionString)-> failwithf $"Unable to parse sdk version from the string '{erroringVersionString}'. This value came from running `{dotnetExe} {args}` at path {cwd}"
["DOTNET_HOST_PATH", id // is a full path to dotnet binary
18
+
"DOTNET_ROOT",(fun s -> Path.Combine(s, dotnetBinaryName))// needs dotnet binary appended
19
+
"DOTNET_ROOT(x86)",(fun s -> Path.Combine(s, dotnetBinaryName))]// needs dotnet binary appended
20
+
21
+
letprivateexistingEnvVarValue envVarValue =
22
+
match envVarValue with
8
23
|null
9
-
|""->
10
-
System
11
-
.Diagnostics
12
-
.Process
13
-
.GetCurrentProcess()
14
-
.MainModule
15
-
.FileName
16
-
| alreadySet -> alreadySet
24
+
|""-> None
25
+
| other -> Some other
26
+
27
+
/// <summary>
28
+
/// provides the path to the `dotnet` binary running this library, respecting various dotnet <see href="https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_root-dotnet_rootx86%5D">environment variables</see>
29
+
/// </summary>
30
+
letdotnetRoot=
31
+
potentialDotnetHostEnvVars
32
+
|> List.tryPick
33
+
(fun(envVar,transformer)->
34
+
match Environment.GetEnvironmentVariable envVar |> existingEnvVarValue with
35
+
| Some varValue -> Some(transformer varValue |> FileInfo)
0 commit comments