Skip to content

Commit 2c9bde7

Browse files
committed
.NET 11
1 parent 50b4a2c commit 2c9bde7

File tree

12 files changed

+30
-23
lines changed

12 files changed

+30
-23
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v5
1919
with:
20-
dotnet-version: '10.0.201'
20+
dotnet-version: '11.0.100-preview.2.26159.112'
2121

2222
- name: Build Unit Tests .NET
23-
run: dotnet build -f net10.0 test/Renci.SshNet.Tests/
23+
run: dotnet build -f net11.0 test/Renci.SshNet.Tests/
2424

2525
- name: Build IntegrationTests .NET
26-
run: dotnet build -f net10.0 test/Renci.SshNet.IntegrationTests/
26+
run: dotnet build -f net11.0 test/Renci.SshNet.IntegrationTests/
2727

2828
- name: Run Unit Tests .NET
2929
run: |
3030
dotnet test \
31-
-f net10.0 \
31+
-f net11.0 \
3232
--no-build \
3333
--logger "console;verbosity=normal" \
3434
--logger GitHubActions \
@@ -40,7 +40,7 @@ jobs:
4040
- name: Run Integration Tests .NET
4141
run: |
4242
dotnet test \
43-
-f net10.0 \
43+
-f net11.0 \
4444
--no-build \
4545
--logger "console;verbosity=normal" \
4646
--logger GitHubActions \
@@ -66,7 +66,7 @@ jobs:
6666
- name: Setup .NET
6767
uses: actions/setup-dotnet@v5
6868
with:
69-
dotnet-version: '10.0.201'
69+
dotnet-version: '11.0.100-preview.2.26159.112'
7070

7171
- name: Build Solution
7272
run: dotnet build Renci.SshNet.slnx
@@ -86,7 +86,7 @@ jobs:
8686
- name: Run Unit Tests .NET
8787
run: |
8888
dotnet test `
89-
-f net10.0 `
89+
-f net11.0 `
9090
--no-build `
9191
--logger "console;verbosity=normal" `
9292
--logger GitHubActions `
@@ -119,7 +119,7 @@ jobs:
119119
- name: Setup .NET
120120
uses: actions/setup-dotnet@v5
121121
with:
122-
dotnet-version: '10.0.201'
122+
dotnet-version: '11.0.100-preview.2.26159.112'
123123

124124
- name: Setup WSL2
125125
uses: Vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0
@@ -163,7 +163,7 @@ jobs:
163163
- name: Setup .NET
164164
uses: actions/setup-dotnet@v5
165165
with:
166-
dotnet-version: '10.0.201'
166+
dotnet-version: '11.0.100-preview.2.26159.112'
167167

168168
- name: Setup WSL2
169169
uses: Vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0
@@ -181,7 +181,7 @@ jobs:
181181
- name: Run Integration Tests .NET
182182
run:
183183
dotnet test `
184-
-f net10.0 `
184+
-f net11.0 `
185185
--logger "console;verbosity=normal" `
186186
--logger GitHubActions `
187187
-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.100",
3+
"version": "11.0.100-preview.2.26159.112",
44
"rollForward": "latestFeature"
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.InvariantCulture);
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.InvariantCulture);
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.InvariantCulture);
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.InvariantCulture) + 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.InvariantCulture) + 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)