Created
July 22, 2015 12:43
-
-
Save EricZimmerman/fd1e3b55b34206d3d750 to your computer and use it in GitHub Desktop.
Check for .net 4.6 or greater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool CheckForDotnet46() | |
{ | |
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\")) | |
{ | |
int releaseKey = Convert.ToInt32(ndpKey.GetValue("Release")); | |
return (releaseKey >= 393295); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use like this: