Change means of accessing file version (#5783)
Change means of accessing file version (#5783)

Fixes one of the causes for https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1172859

Customer Impact
Some (but not all) customers will stop having repeatedly failing node handshakes, allowing them to build without restarting Visual Studio. A change in 16.7 relied more heavily upon a flaky API that this change avoids.

Testing
The current fix is part of 16.8, and one customer who had experienced the problem with 16.7 tentatively suggested that 16.8 was not broken. Also, all the customers who have reported difficulties and provided COMM traces indicating they shared this problem were using 16.7 at the time.

Risk
Very low. The code change is minimal, the new way of looking up a version is already in use in 16.8 without it causing problems, as far as we know, and the new version is scoped to a change in a single part of a single function, just responsible for looking up the version.

Code Reviewers
@rainersigwald

Description of fix
Reflects over the executing assembly to find its version instead of looping over its attributes in search of its version. The latter approach apparently sometimes returns an empty string, which is treated as a valid version that doesn't match any other versions, causing the inability to connect customers experienced.
rainersigwald/msbuild,cdmihai/msbuild,rainersigwald/msbuild,rainersigwald/msbuild,cdmihai/msbuild,AndyGerlicher/msbuild,mono/msbuild,AndyGerlicher/msbuild,sean-gilliam/msbuild,mono/msbuild,AndyGerlicher/msbuild,sean-gilliam/msbuild,mono/msbuild,cdmihai/msbuild,cdmihai/msbuild,mono/msbuild,rainersigwald/msbuild,sean-gilliam/msbuild,sean-gilliam/msbuild,AndyGerlicher/msbuild