Add support for dotnet 10 (#2229)

* Add dotnet10 as target framework and fix breaking changes

* Fix tests

* Fix tests for CI

* Fix typo
This commit is contained in:
Christian
2025-12-07 16:24:34 +01:00
committed by GitHub
parent d74d83453f
commit 1a3e97afec
12 changed files with 35 additions and 11 deletions
@@ -122,10 +122,12 @@ public sealed class HotSwapCerts_Tests
certRequest.CertificateExtensions.Add(sanBuilder.Build());
using var certificate = certRequest.CreateSelfSigned(DateTimeOffset.Now.AddMinutes(-10), DateTimeOffset.Now.AddMinutes(10));
#pragma warning disable SYSLIB0057
var pfxCertificate = new X509Certificate2(
certificate.Export(X509ContentType.Pfx),
(string)null,
X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
#pragma warning restore SYSLIB0057
return pfxCertificate;
}
+3 -2
View File
@@ -1,5 +1,6 @@
#if DEBUG
using System.Globalization;
using MQTTnet.Internal;
using MQTTnet.Packets;
using MQTTnet.Protocol;
@@ -52,7 +53,7 @@ public sealed class Load_Tests : BaseTestClass
for (var j = 0; j < 1000; j++)
{
publishPacket.Topic = j.ToString();
publishPacket.Topic = j.ToString(CultureInfo.InvariantCulture);
await client.SendAsync(publishPacket, CancellationToken.None);
}
@@ -139,7 +140,7 @@ public sealed class Load_Tests : BaseTestClass
for (var j = 0; j < 1000; j++)
{
var message = applicationMessageBuilder.WithTopic(j.ToString()).Build();
var message = applicationMessageBuilder.WithTopic(j.ToString(CultureInfo.InvariantCulture)).Build();
await client.PublishAsync(message);
}
@@ -520,10 +520,11 @@ public sealed class SubscriptionTopicHashTests : IDisposable
static byte[] GetBytes(ulong value)
{
var bytes = BitConverter.GetBytes(value);
// Ensure that highest byte comes first for comparison left to right
if (BitConverter.IsLittleEndian)
{
return bytes.Reverse().ToArray();
bytes = bytes.AsEnumerable().Reverse().ToArray();
}
return bytes;
+2
View File
@@ -31,10 +31,12 @@ public sealed class Tls_Tests : BaseTestClass
certRequest.CertificateExtensions.Add(sanBuilder.Build());
using var certificate = certRequest.CreateSelfSigned(DateTimeOffset.Now.AddMinutes(-10), DateTimeOffset.Now.AddMinutes(10));
#pragma warning disable SYSLIB0057
var pfxCertificate = new X509Certificate2(
certificate.Export(X509ContentType.Pfx),
(string)null,
X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
#pragma warning restore SYSLIB0057
return pfxCertificate;
}