From 3dda5c92ceb373a0947ee02e105516309e15c8cb Mon Sep 17 00:00:00 2001 From: mus65 Date: Sat, 24 Aug 2024 12:50:00 +0200 Subject: [PATCH] another .NET 9 SDK Build fix (#1475) see 1b71e8fea48986decbfbecd4c656822c034e5601 and https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1872 --- .../Classes/Security/Cryptography/DsaKeyTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Renci.SshNet.Tests/Classes/Security/Cryptography/DsaKeyTest.cs b/test/Renci.SshNet.Tests/Classes/Security/Cryptography/DsaKeyTest.cs index 831b49a73..aefc8e513 100644 --- a/test/Renci.SshNet.Tests/Classes/Security/Cryptography/DsaKeyTest.cs +++ b/test/Renci.SshNet.Tests/Classes/Security/Cryptography/DsaKeyTest.cs @@ -24,7 +24,11 @@ private static DsaKey GetDsaKey(string fileName, string passPhrase = null) // This is just to line up any differences in the assertion message. private static void AssertEqual(byte[] actualBytes, string expectedHex) { +#if NET + string actualHex = Convert.ToHexString(actualBytes); +#else string actualHex = BitConverter.ToString(actualBytes).Replace("-", ""); +#endif Assert.AreEqual(expectedHex, actualHex, $"{Environment.NewLine}Expected: {expectedHex}{Environment.NewLine} Actual: {actualHex}");