Skip to content

Commit ab93546

Browse files
committed
Use Random.Shared on net6.0 and later
1 parent 4d687a1 commit ab93546

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

projects/RabbitMQ.Client/client/logging/RabbitMqExceptionDetail.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@
3535

3636
namespace RabbitMQ.Client.Logging
3737
{
38-
#if NET452
39-
#else
4038
[EventData]
41-
#endif
4239
public class RabbitMqExceptionDetail
4340
{
4441
public RabbitMqExceptionDetail(Exception ex)

projects/Unit/TestPublisherConfirms.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ public class TestPublisherConfirms : IntegrationFixture
4949

5050
public TestPublisherConfirms(ITestOutputHelper output) : base(output)
5151
{
52+
#if NET6_0_OR_GREATER
5253
Random.Shared.NextBytes(_body);
54+
#else
55+
var rnd = new Random();
56+
rnd.NextBytes(_body);
57+
#endif
5358
}
5459

5560
[Fact]

0 commit comments

Comments
 (0)