You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by da...@apache.org on 2022/08/03 14:31:48 UTC

[logging-log4net] branch master updated: :white_check_mark: ensure that the log4net assembly is always signed

This is an automated email from the ASF dual-hosted git repository.

davydm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git


The following commit(s) were added to refs/heads/master by this push:
     new e26e1dd8 :white_check_mark: ensure that the log4net assembly is always signed
e26e1dd8 is described below

commit e26e1dd8de26daccb4cf34a8698d7965fe52528a
Author: Davyd McColl <da...@gmail.com>
AuthorDate: Wed Aug 3 16:31:28 2022 +0200

    :white_check_mark: ensure that the log4net assembly is always signed
---
 src/log4net.Tests/Signing.cs | 23 +++++++++++++++++++++++
 src/log4net/AssemblyInfo.cs  |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/src/log4net.Tests/Signing.cs b/src/log4net.Tests/Signing.cs
new file mode 100644
index 00000000..86516740
--- /dev/null
+++ b/src/log4net.Tests/Signing.cs
@@ -0,0 +1,23 @@
+using log4net.Repository;
+using NUnit.Framework;
+using NExpect;
+using static NExpect.Expectations;
+
+namespace log4net.Tests
+{
+    [TestFixture]
+    public class Signing
+    {
+        [Test]
+        public void AssemblyShouldBeSigned()
+        {
+            // Arrange
+            var asm = typeof(LoggerRepositorySkeleton).Assembly;
+            // Act
+            var result = asm.GetName().GetPublicKey();
+            // Assert
+            Expect(result)
+                .Not.To.Be.Empty();
+        }       
+    }
+}
\ No newline at end of file
diff --git a/src/log4net/AssemblyInfo.cs b/src/log4net/AssemblyInfo.cs
index 44905c3f..a767ff7a 100644
--- a/src/log4net/AssemblyInfo.cs
+++ b/src/log4net/AssemblyInfo.cs
@@ -20,6 +20,8 @@
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+// [assembly:AssemblyKeyFile("log4net.snk")]
+
 #if (!SSCLI)
 //
 // log4net makes use of static methods which cannot be made com visible