JJ.Framework.PlatformCompatibility.Core
4.5.6073
Prefix Reserved
dotnet add package JJ.Framework.PlatformCompatibility.Core --version 4.5.6073
NuGet\Install-Package JJ.Framework.PlatformCompatibility.Core -Version 4.5.6073
<PackageReference Include="JJ.Framework.PlatformCompatibility.Core" Version="4.5.6073" />
<PackageVersion Include="JJ.Framework.PlatformCompatibility.Core" Version="4.5.6073" />
<PackageReference Include="JJ.Framework.PlatformCompatibility.Core" />
paket add JJ.Framework.PlatformCompatibility.Core --version 4.5.6073
#r "nuget: JJ.Framework.PlatformCompatibility.Core, 4.5.6073"
#:package JJ.Framework.PlatformCompatibility.Core@4.5.6073
#addin nuget:?package=JJ.Framework.PlatformCompatibility.Core&version=4.5.6073
#tool nuget:?package=JJ.Framework.PlatformCompatibility.Core&version=4.5.6073
JJ.Framework.PlatformCompatibility.Core
Shims that mimic new features for old .NETs, so new code can compile for older tech.
It's internal tooling in support of the JJ projects and only supports a limited selection.
Background
When you want a single code base to compile on both old and new .NETs, you run into trouble. Things like init, required and nullability attributes: they just aren't there on older targets.
These shims step in silently: on platforms that already have the real thing, they stay out of the way. On older ones, they provide just enough so the compiler stops complaining. Sometimes the behavior may be a no-op, but at least it compiles and things keep working.
The following shims have been added:
Argument Checks
Newer .NETs added shorthand throws which aren't there yet in some older .NET versions:
ThrowIfNullThrowIfNullOrWhiteSpace
Language Features
A few language keywords that older .NET versions don't support without a stub somewhere:
[RequiredMember]- needed for therequiredkeyword on older targets.[CallerArgumentExpression]- needed to extract the text of the expression of how the argument is passed.[OverloadResolutionPriority]- hints to the compiler which overload to prefer, when there's ambiguity.IsExternalInit- needed forinit-only setters.[CompilerFeatureRequired]- lets a type signal it relies on a specific compiler feature.
Nullability
Nullability attributes might be missing on older platforms:
[NotNull]- tells the compiler a value won't come outnull.[NotNullWhen]- same, but only when the method returns a particular Boolean value.
As PlatformCompatibility.Core makes sure they're there, the compiler knows what to do with them, and the nullability intents are used, even for older .NET versions.
Trimming / AOT
When publishing with trimming or native compilation (AOT), the compiler needs hints about what to keep. These attributes carry those hints. On platforms that don't know them yet, the shims provide the same code at least compiles:
[DynamicallyAccessedMembers][DynamicallyAccessedMemberTypes][DynamicDependency][RequiresUnreferencedCode][RequiresDynamicCode][UnconditionalSuppressMessage]
Threading
Lock- a new type introduced for more efficient locking, backported so the same locking pattern compiles on older targets.
Utilities
HashCode-HashCode.Combine(...)for older.NETversions that don't have it built in.
Release Notes
2026-04-04 | 4.4/0.252 : Initial
- Run new code on older .NETs
- Shims for argument checks, language features, nullability, trimming/AOT, threading and hash codes
- Full test coverage and member docs
💬 Feedback
Got feedback or questions? You can reach me here.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 is compatible. 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. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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 is compatible. 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. |
-
.NETFramework 4.6.1
- JJ.Framework.Build (>= 4.5.6073)
-
.NETStandard 2.0
- JJ.Framework.Build (>= 4.5.6073)
-
.NETStandard 2.1
- JJ.Framework.Build (>= 4.5.6073)
-
net10.0
- JJ.Framework.Build (>= 4.5.6073)
-
net5.0
- JJ.Framework.Build (>= 4.5.6073)
-
net6.0
- JJ.Framework.Build (>= 4.5.6073)
-
net7.0
- JJ.Framework.Build (>= 4.5.6073)
-
net8.0
- JJ.Framework.Build (>= 4.5.6073)
-
net9.0
- JJ.Framework.Build (>= 4.5.6073)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.