From 1cb294e2c7d9a0a108572b0425a52892e55eef77 Mon Sep 17 00:00:00 2001 From: Richard Pope Date: Mon, 30 Sep 2024 13:29:39 +0100 Subject: [PATCH] Resolves #640 - Adds type-forwarders NET 5.0+ --- src/NATS.Client.Core/Internal/netstandard.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NATS.Client.Core/Internal/netstandard.cs b/src/NATS.Client.Core/Internal/netstandard.cs index 0194dd9bb..50596ccc1 100644 --- a/src/NATS.Client.Core/Internal/netstandard.cs +++ b/src/NATS.Client.Core/Internal/netstandard.cs @@ -10,9 +10,11 @@ #pragma warning disable SA1204 #pragma warning disable SA1405 -#if NETSTANDARD - // Enable init only setters +#if NET5_0_OR_GREATER +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsExternalInit))] +#elif NETSTANDARD + namespace System.Runtime.CompilerServices { internal static class IsExternalInit @@ -33,7 +35,9 @@ internal sealed class SkipLocalsInitAttribute : Attribute { } } +#endif +#if NETSTANDARD namespace System.Diagnostics { internal sealed class StackTraceHiddenAttribute : Attribute