Skip to content

Commit d53a40c

Browse files
authored
Upgrade version of some packages needing system.memory (#3056)
* Upgrade version of some packages needing system.memory, so they use the same vesion (4:0:1:2) than System.Hashing.IO System.Hashing.IO can not be downgraded for old .net because first version with XxHash3 use system.memory 4:0:1:2 * Fix implementation of interface that now match modern syntax
1 parent 89270ea commit d53a40c

3 files changed

Lines changed: 3 additions & 19 deletions

File tree

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project>
22
<ItemGroup>
33
<!-- Packages we depend on for StackExchange.Redis, upgrades can create binding redirect pain! -->
4-
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
5-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
6-
<PackageVersion Include="Pipelines.Sockets.Unofficial" Version="2.2.8" />
4+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.14" />
5+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
6+
<PackageVersion Include="Pipelines.Sockets.Unofficial" Version="2.2.16" />
77
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="5.0.0" />
88
<PackageVersion Include="System.Threading.Channels" Version="5.0.0" />
99
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />

src/StackExchange.Redis/TextWriterLogger.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ public TextWriterLogger(TextWriter writer, ILogger? wrapped)
1717
_wrapped = wrapped;
1818
}
1919

20-
#if NET8_0_OR_GREATER
2120
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => NothingDisposable.Instance;
22-
#else
23-
public IDisposable BeginScope<TState>(TState state) => NothingDisposable.Instance;
24-
#endif
2521

2622
public bool IsEnabled(LogLevel logLevel) => _writer is not null || _wrapped is not null;
2723
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)

tests/StackExchange.Redis.Tests/LoggerTests.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ public class TestWrapperLogger(ILogger toWrap) : ILogger
6262
public int LogCount = 0;
6363
private ILogger Inner { get; } = toWrap;
6464

65-
#if NET8_0_OR_GREATER
6665
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => Inner.BeginScope(state);
67-
#else
68-
public IDisposable BeginScope<TState>(TState state) => Inner.BeginScope(state);
69-
#endif
7066
public bool IsEnabled(LogLevel logLevel) => Inner.IsEnabled(logLevel);
7167
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
7268
{
@@ -80,11 +76,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
8076
/// </summary>
8177
private sealed class TestMultiLogger(params ILogger[] loggers) : ILogger
8278
{
83-
#if NET8_0_OR_GREATER
8479
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
85-
#else
86-
public IDisposable BeginScope<TState>(TState state) => null!;
87-
#endif
8880
public bool IsEnabled(LogLevel logLevel) => true;
8981
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
9082
{
@@ -104,11 +96,7 @@ private sealed class TestLogger : ILogger
10496
public TestLogger(LogLevel logLevel, TextWriter output) =>
10597
(_logLevel, _output) = (logLevel, output);
10698

107-
#if NET8_0_OR_GREATER
10899
public IDisposable? BeginScope<TState>(TState state) where TState : notnull => null;
109-
#else
110-
public IDisposable BeginScope<TState>(TState state) => null!;
111-
#endif
112100
public bool IsEnabled(LogLevel logLevel) => logLevel >= _logLevel;
113101
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
114102
{

0 commit comments

Comments
 (0)