问题描述:

The current Windows Technical Preview for Enterprise (Build 9860) seems to have broken .NET version information. Furthermore this behavior seems to be present for Visual Studio 2015/.NET 4.6 Preview as well.

Up until now I was able to use System.Environment.Version to get the CLR build version required to check certain preconditions (e.g. ensure that a certain KB update is present if there are known issues when software is executed in an outdated environment). Given that .NET 4.5 is a drop-in replacement for .NET 4.0 all versions start with 4.0.30319 and end with the actual version in the revision field. Starting with the most recent Windows preview this information seems to be false, inconsistent or at least unexpected. The property now returns 4.0.30319.0 which is a significant step back in terms of version ordering. As a comparison my updated version of windows 8.1 reflects 4.0.30319.34014.

The documentation for .NET 4.5 states that either Environment.Version or a programmatic registry access can be used to determine the installed .NET version.

A registry check yields a release key of 381023 which is above 379893 indicating that at least .NET 4.5.2 is present.

Is there any additional information that would indicate whether this is a bug in the latest preview or if System.Environment should no longer be used that way?

相关阅读:
Top