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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JJ.Framework.PlatformCompatibility.Core" Version="4.5.6073" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JJ.Framework.PlatformCompatibility.Core" Version="4.5.6073" />
                    
Directory.Packages.props
<PackageReference Include="JJ.Framework.PlatformCompatibility.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JJ.Framework.PlatformCompatibility.Core --version 4.5.6073
                    
#r "nuget: JJ.Framework.PlatformCompatibility.Core, 4.5.6073"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JJ.Framework.PlatformCompatibility.Core@4.5.6073
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JJ.Framework.PlatformCompatibility.Core&version=4.5.6073
                    
Install as a Cake Addin
#tool nuget:?package=JJ.Framework.PlatformCompatibility.Core&version=4.5.6073
                    
Install as a Cake Tool

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:

  • ThrowIfNull
  • ThrowIfNullOrWhiteSpace

Language Features

A few language keywords that older .NET versions don't support without a stub somewhere:

  • [RequiredMember] - needed for the required keyword 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 for init-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 out null.
  • [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 .NET versions 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
4.5.6073 29 4/8/2026
4.4.6001 70 4/4/2026