diff --git a/src/OpenTelemetry.Api/Context/RuntimeContextSlotFactory.cs b/src/OpenTelemetry.Api/Context/RuntimeContextSlotFactory.cs index 430f5ca3441..05ac38064bf 100644 --- a/src/OpenTelemetry.Api/Context/RuntimeContextSlotFactory.cs +++ b/src/OpenTelemetry.Api/Context/RuntimeContextSlotFactory.cs @@ -40,8 +40,8 @@ public override RuntimeContextSlot Create(string name) public sealed class ThreadLocalRuntimeContextSlotFactory : RuntimeContextSlotFactory { - public override RuntimeContextSlot Create(string name) - => new ThreadLocalRuntimeContextSlot(name); + public override RuntimeContextSlot Create(string name) + => new ThreadLocalRuntimeContextSlot(name); } [RequiresUnreferencedCode("ReflectionRuntimeContextSlotFactory is trimmer unsafe.")] diff --git a/src/OpenTelemetry.Api/OpenTelemetry.Api.csproj b/src/OpenTelemetry.Api/OpenTelemetry.Api.csproj index 7fc0e80c41c..5c88e043ddb 100644 --- a/src/OpenTelemetry.Api/OpenTelemetry.Api.csproj +++ b/src/OpenTelemetry.Api/OpenTelemetry.Api.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj b/src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj index 7883a6a6ce4..a8e036cb834 100644 --- a/src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj +++ b/src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj b/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj index fca67247cc3..17a9ead00de 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj +++ b/src/OpenTelemetry.Exporter.Jaeger/OpenTelemetry.Exporter.Jaeger.csproj @@ -29,7 +29,7 @@ - + diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj index 232e4905526..06deeb6e939 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj @@ -36,7 +36,7 @@ - + diff --git a/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj b/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj index a049e7ecca1..60aca39347e 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj +++ b/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/OpenTelemetry/Internal/Shims/RequiresUnreferencedCodeAttribute.cs b/src/OpenTelemetry/Internal/Shims/RequiresUnreferencedCodeAttribute.cs index 897b8f92787..3d0bbaa27ad 100644 --- a/src/OpenTelemetry/Internal/Shims/RequiresUnreferencedCodeAttribute.cs +++ b/src/OpenTelemetry/Internal/Shims/RequiresUnreferencedCodeAttribute.cs @@ -27,12 +27,7 @@ namespace System.Diagnostics.CodeAnalysis /// code from an application. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)] -#if SYSTEM_PRIVATE_CORELIB - public -#else - internal -#endif - sealed class RequiresUnreferencedCodeAttribute : Attribute + internal sealed class RequiresUnreferencedCodeAttribute : Attribute { /// /// Initializes a new instance of the class diff --git a/src/OpenTelemetry/Internal/Shims/UnconditionalSuppressMessageAttribute.cs b/src/OpenTelemetry/Internal/Shims/UnconditionalSuppressMessageAttribute.cs index 0364d91fa65..abecc59d7d8 100644 --- a/src/OpenTelemetry/Internal/Shims/UnconditionalSuppressMessageAttribute.cs +++ b/src/OpenTelemetry/Internal/Shims/UnconditionalSuppressMessageAttribute.cs @@ -15,6 +15,7 @@ // #nullable enable +#if !NET7_OR_GREATER namespace System.Diagnostics.CodeAnalysis { /// @@ -97,3 +98,4 @@ public UnconditionalSuppressMessageAttribute(string category, string checkId) public string? Justification { get; set; } } } +#endif