Skip to content

Commit cdb9cc4

Browse files
committed
.NET 11
1 parent 89f378a commit cdb9cc4

12 files changed

Lines changed: 29 additions & 19 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
permissions:
1414
contents: read
1515

16+
env:
17+
DOTNET_TARGET_FRAMEWORK: net11.0
18+
1619
jobs:
1720
Linux:
1821
runs-on: ubuntu-24.04
@@ -27,15 +30,15 @@ jobs:
2730
uses: actions/setup-dotnet@9a946fdbd5fb07b82b2f5a4466058b876ab72bb2 # v5.3.0
2831

2932
- name: Build Unit Tests .NET
30-
run: dotnet build -f net10.0 test/Renci.SshNet.Tests/
33+
run: dotnet build -f ${{ env.DOTNET_TARGET_FRAMEWORK }} test/Renci.SshNet.Tests/
3134

3235
- name: Build IntegrationTests .NET
33-
run: dotnet build -f net10.0 test/Renci.SshNet.IntegrationTests/
36+
run: dotnet build -f ${{ env.DOTNET_TARGET_FRAMEWORK }} test/Renci.SshNet.IntegrationTests/
3437

3538
- name: Run Unit Tests .NET
3639
run: |
3740
dotnet test \
38-
-f net10.0 \
41+
-f ${{ env.DOTNET_TARGET_FRAMEWORK }} \
3942
--no-build \
4043
--logger "console;verbosity=normal" \
4144
--logger GitHubActions \
@@ -47,7 +50,7 @@ jobs:
4750
- name: Run Integration Tests .NET
4851
run: |
4952
dotnet test \
50-
-f net10.0 \
53+
-f ${{ env.DOTNET_TARGET_FRAMEWORK }} \
5154
--no-build \
5255
--logger "console;verbosity=normal" \
5356
--logger GitHubActions \
@@ -92,7 +95,7 @@ jobs:
9295
- name: Run Unit Tests .NET
9396
run: |
9497
dotnet test `
95-
-f net10.0 `
98+
-f ${{ env.DOTNET_TARGET_FRAMEWORK }} `
9699
--no-build `
97100
--logger "console;verbosity=normal" `
98101
--logger GitHubActions `
@@ -185,7 +188,7 @@ jobs:
185188
- name: Run Integration Tests .NET
186189
run:
187190
dotnet test `
188-
-f net10.0 `
191+
-f ${{ env.DOTNET_TARGET_FRAMEWORK }} `
189192
--logger "console;verbosity=normal" `
190193
--logger GitHubActions `
191194
-p:CollectCoverage=true `

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "10.0.201",
3+
"version": "11.0.100-preview.5.26302.115",
44
"rollForward": "latestMinor"
55
}
66
}

src/Renci.SshNet/Abstractions/StringExtensions.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ public int IndexOf(char value, StringComparison comparisonType)
3030
return text.IndexOf(value.ToString(), comparisonType);
3131
}
3232
#endif
33+
34+
#if !NET11_0_OR_GREATER
35+
public int LastIndexOf(char value, StringComparison comparisonType)
36+
{
37+
return text.LastIndexOf(value.ToString(), comparisonType);
38+
}
39+
#endif
3340
}
3441
}
3542
}

src/Renci.SshNet/Common/PacketDump.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private static string AsHex(byte[] data, int length)
7070

7171
if (length < data.Length)
7272
{
73-
_ = hex.Append(new string(' ', (data.Length - length) * 3));
73+
_ = hex.Append(' ', (data.Length - length) * 3);
7474
}
7575

7676
return hex.ToString();

src/Renci.SshNet/Common/PosixPath.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static PosixPath CreateAbsoluteOrRelativeFilePath(string path)
4242

4343
var posixPath = new PosixPath();
4444

45-
var pathEnd = path.LastIndexOf('/');
45+
var pathEnd = path.LastIndexOf('/', StringComparison.Ordinal);
4646
if (pathEnd == -1)
4747
{
4848
if (path.Length == 0)
@@ -94,7 +94,7 @@ public static string GetFileName(string path)
9494
{
9595
ArgumentNullException.ThrowIfNull(path);
9696

97-
var pathEnd = path.LastIndexOf('/');
97+
var pathEnd = path.LastIndexOf('/', StringComparison.Ordinal);
9898
if (pathEnd == -1)
9999
{
100100
return path;
@@ -121,7 +121,7 @@ public static string GetDirectoryName(string path)
121121
{
122122
ArgumentNullException.ThrowIfNull(path);
123123

124-
var pathEnd = path.LastIndexOf('/');
124+
var pathEnd = path.LastIndexOf('/', StringComparison.Ordinal);
125125
if (pathEnd == -1)
126126
{
127127
return ".";

src/Renci.SshNet/Renci.SshNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AssemblyName>Renci.SshNet</AssemblyName>
55
<Product>SSH.NET</Product>
66
<AssemblyTitle>SSH.NET</AssemblyTitle>
7-
<TargetFrameworks>net462;netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
7+
<TargetFrameworks>net462;netstandard2.0;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
88
</PropertyGroup>
99

1010
<PropertyGroup>

src/Renci.SshNet/Sftp/SftpFile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal SftpFile(ISftpSession sftpSession, string fullName, SftpFileAttributes
3838

3939
_sftpSession = sftpSession;
4040
Attributes = attributes;
41-
Name = fullName.Substring(fullName.LastIndexOf('/') + 1);
41+
Name = fullName.Substring(fullName.LastIndexOf('/', StringComparison.Ordinal) + 1);
4242
FullName = fullName;
4343
}
4444

@@ -491,7 +491,7 @@ public void MoveTo(string destFileName)
491491

492492
var fullPath = _sftpSession.GetCanonicalPath(destFileName);
493493

494-
Name = fullPath.Substring(fullPath.LastIndexOf('/') + 1);
494+
Name = fullPath.Substring(fullPath.LastIndexOf('/', StringComparison.Ordinal) + 1);
495495

496496
FullName = fullPath;
497497
}

test/Renci.SshNet.AotCompatibilityTestApp/Renci.SshNet.AotCompatibilityTestApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
5+
<TargetFramework>net11.0</TargetFramework>
66
<PublishAot>true</PublishAot>
77
<SelfContained>true</SelfContained>
88
<TrimmerSingleWarn>false</TrimmerSingleWarn>

test/Renci.SshNet.Benchmarks/Renci.SshNet.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
5+
<TargetFramework>net11.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

test/Renci.SshNet.IntegrationBenchmarks/Renci.SshNet.IntegrationBenchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net10.0</TargetFramework>
5+
<TargetFramework>net11.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

0 commit comments

Comments
 (0)