1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
7 class enviroment_version
11 Version ver = Environment.Version;
12 Console.WriteLine($"Environment.Version = {ver}");
14 if (ver < new Version("3.0"))
16 Console.WriteLine("ERROR: Version less than 3.0.");
20 // Verify that we are not returning hardcoded version from .NET Framework.
21 if (ver == new Version("4.0.30319.42000"))
23 Console.WriteLine("ERROR: Version is hardcoded .NET Framework version.");
27 // .NET Core assemblies use 4.6+ as file version. Verify that we have not used
28 // the file version as product version by accident.
29 if (ver.Major == 4 && (ver.Minor >= 6))
31 Console.WriteLine("ERROR: Version is 4.6+.");
35 Console.WriteLine("PASSED");