-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
SdkResolutionResult.cs
49 lines (43 loc) · 1.76 KB
/
SdkResolutionResult.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//only Microsoft.DotNet.NativeWrapper (net7.0) has nullables disabled
#pragma warning disable IDE0240 // Remove redundant nullable directive
#nullable disable
#pragma warning restore IDE0240 // Remove redundant nullable directive
namespace Microsoft.DotNet.NativeWrapper
{
public class SdkResolutionResult
{
/// <summary>
/// Path to .NET Core SDK selected by hostfxr (e.g. C:\Program Files\dotnet\sdk\2.1.300).
/// </summary>
public string ResolvedSdkDirectory;
/// <summary>
/// Path to global.json file that impacted resolution.
/// </summary>
public string GlobalJsonPath;
/// <summary>
/// The .NET SDK version specified in <strong>global.json</strong>.
/// </summary>
public string RequestedVersion;
/// <summary>
/// True if a global.json was found but there was no compatible SDK, so it was ignored.
/// </summary>
public bool FailedToResolveSDKSpecifiedInGlobalJson;
internal void Initialize(Interop.hostfxr_resolve_sdk2_result_key_t key, string value)
{
switch (key)
{
case Interop.hostfxr_resolve_sdk2_result_key_t.resolved_sdk_dir:
ResolvedSdkDirectory = value;
break;
case Interop.hostfxr_resolve_sdk2_result_key_t.global_json_path:
GlobalJsonPath = value;
break;
case Interop.hostfxr_resolve_sdk2_result_key_t.requested_version:
RequestedVersion = value;
break;
}
}
}
}