Skip to content

Commit

Permalink
allow the users to choose .NET 4.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik committed Feb 22, 2018
1 parent e547f80 commit 28aa946
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -22,6 +22,7 @@ public class CsProjClassicNetToolchain : Toolchain
[PublicAPI] public static readonly IToolchain Net461 = new CsProjClassicNetToolchain("net461");
[PublicAPI] public static readonly IToolchain Net462 = new CsProjClassicNetToolchain("net462");
[PublicAPI] public static readonly IToolchain Net47 = new CsProjClassicNetToolchain("net47");
[PublicAPI] public static readonly IToolchain Net471 = new CsProjClassicNetToolchain("net471");
private static readonly IToolchain Default = Net46; // the lowest version we support

[PublicAPI]
Expand Down Expand Up @@ -97,6 +98,8 @@ private static IToolchain GetCurrentVersionBasedOnWindowsRegistry()

int releaseKey = Convert.ToInt32(ndpKey.GetValue("Release"));
// magic numbers come from https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx
if (releaseKey >= 461308 && Directory.Exists(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1"))
return Net471;
if (releaseKey >= 460798 && Directory.Exists(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7"))
return Net47;
if (releaseKey >= 394802 && Directory.Exists(@"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2"))
Expand Down

0 comments on commit 28aa946

Please sign in to comment.