VS2017 からレジストリの構成が変わっている。

Path to MSBuild
How can I programatically get the path to MSBuild from a machine where my .exe is running? I can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET
Path to MSBuild favicon http://stackoverflow.com/questions/328017/path-to-msbuild
Path to MSBuild
public static string CalcMSBuildPath(string msBuildVersion)
{
if (msBuildVersion == "15.0")
{
using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7"))
{
if (key == null)
{
return null;
}
string folder = key.GetValue(msBuildVersion) as string;
string msBuildPath = Path.Combine(folder, "MSBuild\\15.0\\Bin\\msbuild.exe");
return msBuildPath;
}
}
// 既存のコード
}