OperatingSystem.IsLinux Method

Definition

Indicates whether the current application is running on Linux.

C#
public static bool IsLinux();

Returns

true if the current application is running on Linux; false otherwise.

Applies to

Product Versions
.NET 5, 6, 7, 8, 9