Skip to content

Commit 8cd6ad6

Browse files
mus65Rob-Hague
andauthored
fix Build with newer .NET 10 SDKs (#1772)
* fix Build with newer .NET 10 SDKs The IDE0370 are a mess since they only affect certain target frameworks. Maybe we should disable this one completely instead? Also set a fixed SDK Version in CI so this doesn't randomly break again. * Remove IDE0370 * global.json: use latestMinor to make sure that dotnet-setup installs the exact version, see #1772 (comment) * Update global.json Co-authored-by: Rob Hague <rob.hague00@gmail.com> --------- Co-authored-by: Rob Hague <rob.hague00@gmail.com>
1 parent c3da85d commit 8cd6ad6

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,11 @@ dotnet_diagnostic.IDE0300.severity = none
847847
# TODO: Discuss whether we want to start using this
848848
dotnet_diagnostic.IDE0301.severity = none
849849

850+
# IDE0370: Remove unnecessary suppression
851+
#
852+
# This can lead to many false positives in different target frameworks.
853+
dotnet_diagnostic.IDE0370.severity = suggestion
854+
850855
#### .NET Compiler Platform code style rules ####
851856

852857
### Language rules ###

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.100",
4-
"rollForward": "latestFeature"
3+
"version": "10.0.201",
4+
"rollForward": "latestMinor"
55
}
66
}

src/Renci.SshNet/ForwardedPort.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ protected virtual void StopPort(TimeSpan timeout)
105105
RaiseClosing();
106106

107107
var session = Session;
108-
if (session is not null)
109-
{
110-
session.ErrorOccured -= Session_ErrorOccurred;
111-
}
108+
session?.ErrorOccured -= Session_ErrorOccurred;
112109
}
113110

114111
/// <summary>

src/Renci.SshNet/OrderedDictionary.netstandard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public bool Remove(TKey key, [MaybeNullWhen(false)] out TValue value)
234234
}
235235

236236
AssertConsistency();
237-
value = default!;
237+
value = default;
238238
return false;
239239
}
240240

test/Renci.SshNet.Tests/Classes/AbstractionsTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
using Renci.SshNet.Abstractions;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
using Renci.SshNet.Abstractions;
4+
35
using System;
46
using System.Threading;
57
using System.Security.Cryptography;

0 commit comments

Comments
 (0)