Not sure if we should check revision too, but this is good enough for what we want. This will be needed to load the correct Microsoft.Build when we switch to the nuget version. Manual cherry-pick of af4acb5b11 (relevant parts)
af4acb5b11