summary refs log tree commit diff
path: root/crypto/src/AssemblyInfo.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-24 11:51:46 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-24 11:51:46 +0700
commitda81fe89f8179dfbf7ae17753877c8ea1b179a8b (patch)
tree1575aeedd80dd1a47de8367ca90f601fd15d1f49 /crypto/src/AssemblyInfo.cs
parentSome modern syntax updates (diff)
downloadBouncyCastle.NET-ed25519-da81fe89f8179dfbf7ae17753877c8ea1b179a8b.tar.xz
NEW_REFLECTION cleanup
Diffstat (limited to 'crypto/src/AssemblyInfo.cs')
-rw-r--r--crypto/src/AssemblyInfo.cs51
1 files changed, 1 insertions, 50 deletions
diff --git a/crypto/src/AssemblyInfo.cs b/crypto/src/AssemblyInfo.cs
index 568ecf594..f89d58fbd 100644
--- a/crypto/src/AssemblyInfo.cs
+++ b/crypto/src/AssemblyInfo.cs
@@ -1,17 +1,8 @@
 using System;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-#if PORTABLE
-using System.Linq;
-#else
 using System.Runtime.InteropServices;
-#endif
 
 [assembly: CLSCompliant(true)]
-#if !PORTABLE
 [assembly: ComVisible(false)]
-#endif
 
 // Start with no permissions
 //[assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted=false)]
@@ -20,46 +11,7 @@ using System.Runtime.InteropServices;
 // see Org.BouncyCastle.Crypto.Encodings.Pkcs1Encoding.StrictLengthEnabledProperty
 //[assembly: EnvironmentPermission(SecurityAction.RequestOptional, Read="Org.BouncyCastle.Pkcs1.Strict")]
 
-internal class AssemblyInfo
-{
-    private static string version = null;
-
-    public static string Version
-    {
-        get
-        {
-            if (version == null)
-            {
-#if PORTABLE
-#if NEW_REFLECTION
-                var a = typeof(AssemblyInfo).GetTypeInfo().Assembly;
-                var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute));
-#else
-                var a = typeof(AssemblyInfo).Assembly;
-                var c = a.GetCustomAttributes(typeof(AssemblyVersionAttribute), false);
-#endif
-                var v = (AssemblyVersionAttribute)c.FirstOrDefault();
-                if (v != null)
-                {
-                    version = v.Version;
-                }
-#else
-                version = typeof(AssemblyInfo).Assembly.GetName().Version.ToString();
-#endif
-
-                // if we're still here, then don't try again
-                if (version == null)
-                {
-                    version = string.Empty;
-                }
-            }
-
-            return version;
-        }
-    }
-}
-
-#if NET40
+#if !(NET45_OR_GREATER || NETSTANDARD1_0_OR_GREATER)
 namespace System.Reflection
 {
     [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
@@ -76,5 +28,4 @@ namespace System.Reflection
         public string Value { get; }
     }
 }
-
 #endif