Skip to content

Commit 98bc10e

Browse files
Updates for .NET 10 - release-5.0 (#867)
1 parent 948fb38 commit 98bc10e

File tree

12 files changed

+51
-31
lines changed

12 files changed

+51
-31
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: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +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
MongoPersistence.SafeRegisterDefaultGuidSerializer();
15-
16-
var containerConnectionString =
17-
Environment.GetEnvironmentVariable("NServiceBusStorageMongoDB_ConnectionString");
18-
19-
client = string.IsNullOrWhiteSpace(containerConnectionString)
20-
? new MongoClient()
21-
: new MongoClient(containerConnectionString);
16+
var containerConnectionString = Environment.GetEnvironmentVariable("NServiceBusStorageMongoDB_ConnectionString");
17+
field = string.IsNullOrWhiteSpace(containerConnectionString) ? new MongoClient() : new MongoClient(containerConnectionString);
2218
}
2319

20+
return field;
21+
}
22+
#else
23+
get
24+
{
25+
if (client == null)
26+
{
27+
MongoPersistence.SafeRegisterDefaultGuidSerializer();
28+
var containerConnectionString = Environment.GetEnvironmentVariable("NServiceBusStorageMongoDB_ConnectionString");
29+
client = string.IsNullOrWhiteSpace(containerConnectionString) ? new MongoClient() : new MongoClient(containerConnectionString);
30+
}
2431
return client;
2532
}
33+
#endif
2634
}
2735

36+
#if !NET10_0_OR_GREATER
2837
static IMongoClient client;
38+
#endif
2939
}

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: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,38 @@ public class SagaTestsConfiguration
1717

1818
public SagaMetadataCollection SagaMetadataCollection
1919
{
20+
#if NET10_0_OR_GREATER
2021
get
2122
{
22-
if (sagaMetadataCollection == null)
23+
if (field == null)
2324
{
24-
var sagaTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t =>
25-
typeof(Saga).IsAssignableFrom(t) || typeof(IFinder).IsAssignableFrom(t)).ToArray();
26-
sagaMetadataCollection = new SagaMetadataCollection();
27-
sagaMetadataCollection.Initialize(sagaTypes);
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);
2828
}
2929

30+
return field;
31+
}
32+
33+
set;
34+
#else
35+
get
36+
{
37+
if (sagaMetadataCollection == null)
38+
}
3039
return sagaMetadataCollection;
3140
}
3241

3342
set
3443
{
3544
sagaMetadataCollection = value;
3645
}
46+
#endif
3747
}
3848

49+
#if !NET10_0_OR_GREATER
3950
SagaMetadataCollection sagaMetadataCollection;
51+
#endif
4052
readonly MemberMapCache memberMapCache;
4153

4254
public SagaTestsConfiguration(string versionElementName, Func<Type, string> collectionNamingConvention,

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)