AlastairLundy.Extensions.Runtime
2.1.0
Prefix Reserved
AlastairLundy.OSCompatibilityLib
Additional DetailsThis package is deprecated and is longer maintained. Please migrate to the replacement OSCompatibilityLib package.
dotnet add package AlastairLundy.Extensions.Runtime --version 2.1.0
NuGet\Install-Package AlastairLundy.Extensions.Runtime -Version 2.1.0
<PackageReference Include="AlastairLundy.Extensions.Runtime" Version="2.1.0" />
paket add AlastairLundy.Extensions.Runtime --version 2.1.0
#r "nuget: AlastairLundy.Extensions.Runtime, 2.1.0"
// Install AlastairLundy.Extensions.Runtime as a Cake Addin #addin nuget:?package=AlastairLundy.Extensions.Runtime&version=2.1.0 // Install AlastairLundy.Extensions.Runtime as a Cake Tool #tool nuget:?package=AlastairLundy.Extensions.Runtime&version=2.1.0
RuntimeExtensions (formerly known as PlatformKit.Extensions.OperatingSystem)
Features:
Runtime Extensions adds .NET Standard 2.0 & 2.1 compatible ways of getting:
- OS Detection support
- programmatic Runtime Identifier (RID) detection
It also adds some support for programmatically determining the .NET Target Framework Moniker (TFM) being used.
Usage
To get OS Detection support, RuntimeExtensions needs to replace the reference to the existing OperatingSystem class in a .NET Standard 2.0 project with RuntimeExtensions' equivalent class.
This can be easily done with a using namespace.
To target only .NET Standard 2.0 use:
#if NETSTANDARD2_0
using OperatingSystem = AlastairLundy.Extensions.Runtime.OperatingSystemExtensions;
#endif
To target .NET Standard 2.0 and 2.1 use:
#if NETSTANDARD2_0 || NETSTANDARD2_1
using OperatingSystem = AlastairLundy.Extensions.Runtime.OperatingSystemExtensions;
#endif
Compatibility
The following tables indicate Operating Systems that are capable of being detected with this library.
Although "Mac Catalyst" as a target is not explicitly supported, implicit support can be indirectly detected.
You can use:
if(OperatingSystem.IsMacOS()){
if(OperatingSystem.IsAtLeastVersion(10, 15)){
// Mac Catalyst specific code goes here
}
}
Desktop Operating Systems
Operating System Target | Support Status | Required Library Version |
---|---|---|
Windows | ✅, Supported | Any |
Linux | ✅, Supported | Any |
FreeBSD | ✅, Supported | Any |
macOS | ✅, Supported | Any |
Mac Catalyst | ❌, Not Explicitly Supported | N/A, Not Explicitly Supported |
Mobile Operating Systems
Operating System | Support Status | Required Library Version | |
---|---|---|---|
IOS | ✅ | 1.5.0 or newer | |
tvOS | ✅ | 1.5.2 or newer | |
watchOS | ✅ | 1.5.0 or newer | |
Android | ✅ | 1.5.0 or newer | |
Fire OS | ❌, Not Yet Supported | N/A Not Supported | |
Android TV | ❌, Not Supported | N/A Not Supported | |
wearOS | ✅ | 1.5.1 or newer | |
Tizen | ✅ | 2.0.0 or newer |
License
RuntimeExtensions is licensed under the MIT license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|
### Changes since 2.0
* Fixed Source Link implementation in RuntimeExtensions
* Removed dependency on SystemExtensions - All affected methods have been re-written to not rely on it.
* Added some additional xml doc comments
* Added additional OS version comparison methods.
* Removed duplicate code
* Removed support for Windows 8 and Windows 8.1 from Runtime ID generation
* Added PlatformKit logo to RuntimeExtensions Nuget package