Moving Suppress message to assembly level and adding Scope in order to get right...
authorJose Perez Rodriguez <joperezr@microsoft.com>
Fri, 2 Apr 2021 16:23:28 +0000 (09:23 -0700)
committerGitHub <noreply@github.com>
Fri, 2 Apr 2021 16:23:28 +0000 (09:23 -0700)
* Moving Suppress message to assembly level and adding Scope in order to get right suppressing behavior

* Fixing indentation

src/libraries/System.Security.Cryptography.Primitives/src/System/Security/Cryptography/CryptoConfigForwarder.cs

index e5d86ac..bd82112 100644 (file)
@@ -4,11 +4,13 @@
 using System.Diagnostics.CodeAnalysis;
 using System.Reflection;
 
+[assembly: UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
+    Target = "M:System.Security.Cryptography.CryptoConfigForwarder.#cctor",
+    Scope = "member",
+    Justification = "The cctor caches the RequiresUnreferencedCode call in a delegate, and usage of that delegate is marked with RequiresUnreferencedCode.")]
+
 namespace System.Security.Cryptography
 {
-    [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
-        Target = "M:System.Security.Cryptography.CryptoConfigForwarder.#cctor",
-        Justification = "The cctor caches the RequiresUnreferencedCode call in a delegate, and usage of that delegate is marked with RequiresUnreferencedCode.")]
     internal static class CryptoConfigForwarder
     {
         internal const string CreateFromNameUnreferencedCodeMessage = "The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.";