Skip to content

Commit d738809

Browse files
authored
Update remarks for Enviroment.OSVersion (#8996)
1 parent 588e604 commit d738809

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System/Environment.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,9 @@ The following example creates environment variables for the <xref:System.Environ
17651765
17661766
## Remarks
17671767
1768-
In .NET versions prior to .NET 5, <xref:System.Environment.OSVersion?displayProperty=nameWithType> returns an OS version that may be incorrect when an application runs under Windows compatibility mode. For more information, see [GetVersionExA function remarks](/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa#remarks). In .NET 5 and later versions, <xref:System.Environment.OSVersion?displayProperty=nameWithType> always returns the actual OS version. For more information, see [Environment.OSVersion returns the correct operating system version](/dotnet/core/compatibility/core-libraries/5.0/environment-osversion-returns-correct-version).
1768+
<xref:System.Environment.OSVersion?displayProperty=nameWithType> returns an OS version that may be incorrect when an application runs under Windows compatibility mode. For more information, see [GetVersionExA function remarks](/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa#remarks).
1769+
1770+
In .NET 5 and later versions, <xref:System.Environment.OSVersion?displayProperty=nameWithType> returns the actual OS version in compatibility modes specified by the [application manifest](/windows/win32/sysinfo/targeting-your-application-at-windows-8-1). For more information, see [Environment.OSVersion returns the correct operating system version](/dotnet/core/compatibility/core-libraries/5.0/environment-osversion-returns-correct-version).
17691771
17701772
To identify the operating system platform, for example, Linux or Windows, you can use the <xref:System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform%2A?displayProperty=nameWithType> method.
17711773

0 commit comments

Comments
 (0)