Skip to content

Commit d6fab4b

Browse files
Updates for .NET 10 - release-4.2 (#866)
1 parent 16be5ed commit d6fab4b

File tree

12 files changed

+50
-21
lines changed

12 files changed

+50
-21
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@ jobs:
2525
fail-fast: false
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v4.2.2
28+
uses: actions/checkout@v6.0.1
2929
with:
3030
fetch-depth: 0
3131
- name: Setup .NET SDK
32-
uses: actions/setup-dotnet@v4.3.1
32+
uses: actions/setup-dotnet@v5.1.0
3333
with:
34-
dotnet-version: |
35-
9.0.x
36-
8.0.x
34+
global-json-file: global.json
3735
- name: Build
3836
run: dotnet build src --configuration Release
3937
- name: Upload packages
4038
if: matrix.name == 'Windows'
41-
uses: actions/upload-artifact@v4.6.2
39+
uses: actions/upload-artifact@v6.0.0
4240
with:
4341
name: NuGet packages
4442
path: nugets/

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v4.2.2
17+
uses: actions/checkout@v6.0.1
1818
with:
1919
fetch-depth: 0
2020
- name: Setup .NET SDK
21-
uses: actions/setup-dotnet@v4.3.1
21+
uses: actions/setup-dotnet@v5.1.0
2222
with:
23-
dotnet-version: 9.0.x
23+
global-json-file: global.json
2424
- name: Build
2525
run: dotnet build src --configuration Release
2626
- name: Sign NuGet packages
@@ -31,7 +31,7 @@ jobs:
3131
client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
3232
certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}
3333
- name: Publish artifacts
34-
uses: actions/upload-artifact@v4.6.2
34+
uses: actions/upload-artifact@v6.0.0
3535
with:
3636
name: nugets
3737
path: nugets/*

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": "9.0.100",
3+
"version": "10.0.0",
44
"rollForward": "latestFeature"
55
}
66
}

src/NServiceBus.Storage.MongoDB.AcceptanceTests/NServiceBus.Storage.MongoDB.AcceptanceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests/NServiceBus.Storage.MongoDB.NoTx.AcceptanceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/NServiceBus.Storage.MongoDB.PersistenceTests/NServiceBus.Storage.MongoDB.PersistenceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/NServiceBus.Storage.MongoDB.Tests/ClientProvider.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,33 @@ static class ClientProvider
77
{
88
public static IMongoClient Client
99
{
10+
#if NET10_0_OR_GREATER
1011
get
1112
{
12-
if (client == null)
13+
if (field == null)
1314
{
1415
var containerConnectionString = Environment.GetEnvironmentVariable("NServiceBusStorageMongoDB_ConnectionString");
1516

16-
client = string.IsNullOrWhiteSpace(containerConnectionString) ? new MongoClient() : new MongoClient(containerConnectionString);
17+
field = string.IsNullOrWhiteSpace(containerConnectionString) ? new MongoClient() : new MongoClient(containerConnectionString);
1718
}
1819

20+
return field;
21+
}
22+
#else
23+
get
24+
{
25+
if (client == null)
26+
{
27+
var containerConnectionString = Environment.GetEnvironmentVariable("NServiceBusStorageMongoDB_ConnectionString");
28+
client = string.IsNullOrWhiteSpace(containerConnectionString) ? new MongoClient() : new MongoClient(containerConnectionString);
29+
}
1930
return client;
2031
}
32+
#endif
2133
}
2234

35+
#if !NET10_0_OR_GREATER
2336
static IMongoClient client;
37+
#endif
2438
}
2539
}

src/NServiceBus.Storage.MongoDB.Tests/NServiceBus.Storage.MongoDB.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/NServiceBus.Storage.MongoDB.Tests/Sagas/SagaTestsConfiguration.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ public class SagaTestsConfiguration
1717

1818
public SagaMetadataCollection SagaMetadataCollection
1919
{
20+
#if NET10_0_OR_GREATER
21+
get
22+
{
23+
if (field == null)
24+
{
25+
var sagaTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => typeof(Saga).IsAssignableFrom(t) || typeof(IFinder).IsAssignableFrom(t)).ToArray();
26+
field = new SagaMetadataCollection();
27+
field.Initialize(sagaTypes);
28+
}
29+
30+
return field;
31+
}
32+
33+
set;
34+
#else
2035
get
2136
{
2237
if (sagaMetadataCollection == null)
@@ -27,14 +42,16 @@ public SagaMetadataCollection SagaMetadataCollection
2742
}
2843
return sagaMetadataCollection;
2944
}
30-
3145
set
3246
{
3347
sagaMetadataCollection = value;
3448
}
49+
#endif
3550
}
3651

52+
#if !NET10_0_OR_GREATER
3753
SagaMetadataCollection sagaMetadataCollection;
54+
#endif
3855

3956
public SagaTestsConfiguration(string versionElementName, Func<Type, string> collectionNamingConvention, TimeSpan? transactionTimeout = null)
4057
{

src/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests/NServiceBus.Storage.MongoDB.TransactionalSession.AcceptanceTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
4+
<TargetFramework>net10.0</TargetFramework>
55
<!-- We want the root namespace to match the transactional session one -->
66
<RootNamespace>NServiceBus.TransactionalSession.AcceptanceTests</RootNamespace>
77
</PropertyGroup>

0 commit comments

Comments
 (0)