#if NET48 // Polyfills for C# 9+ language features that the helper uses but that net48 BCL doesn't // provide. Keeps the sources single-target-free at the language level — the same .cs files // build on both frameworks without preprocessor guards in the callsites. namespace System.Runtime.CompilerServices { /// Required by C# 9 init-only setters and record types. internal static class IsExternalInit { } } namespace System.Runtime.Versioning { /// /// Minimal shim for the .NET 5+ SupportedOSPlatformAttribute. Pure marker for the /// compiler on net10; on net48 we still want the attribute to exist so the same /// [SupportedOSPlatform("windows")] source compiles. The attribute is internal /// and attribute-targets-everything to minimize surface. /// [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)] internal sealed class SupportedOSPlatformAttribute(string platformName) : Attribute { public string PlatformName { get; } = platformName; } } #endif