Skip to content

Commit dba627a

Browse files
Prepare for NServiceBus 10 (#1611)
* Update workflow files * Fix workflow * Bump major version * Change target framework to net10.0 * Deal with SYSLIB0057 obsolete X509Certificate2 ctor * Update NServiceBus packages * Update testing packages * Update Particular.Packaging * Migrate to slnx solution --------- Co-authored-by: Brandon Ording <[email protected]>
1 parent d159c8f commit dba627a

File tree

23 files changed

+77
-101
lines changed

23 files changed

+77
-101
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ jobs:
3535
- name: Setup .NET SDK
3636
uses: actions/[email protected]
3737
with:
38-
dotnet-version: |
39-
9.0.x
40-
8.0.x
38+
global-json-file: global.json
4139
- name: Build
4240
run: dotnet build src --configuration Release
4341
- name: Upload packages

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup .NET SDK
2121
uses: actions/[email protected]
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

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.0",
4+
"allowPrerelease": true,
45
"rollForward": "latestFeature"
56
}
67
}

src/Custom.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<MinVerMinimumMajorMinor>10.0</MinVerMinimumMajorMinor>
4+
<MinVerMinimumMajorMinor>11.0</MinVerMinimumMajorMinor>
55
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
66
</PropertyGroup>
77

src/NServiceBus.Transport.RabbitMQ.AcceptanceTests/NServiceBus.Transport.RabbitMQ.AcceptanceTests.csproj

Lines changed: 3 additions & 3 deletions
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
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
77
</PropertyGroup>
@@ -12,14 +12,14 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
1616
<PackageReference Include="NUnit" Version="4.3.2" />
1717
<PackageReference Include="NUnit.Analyzers" Version="4.7.0" />
1818
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="9.2.7" GeneratePathProperty="true" />
22+
<PackageReference Include="NServiceBus.AcceptanceTests.Sources" Version="10.0.0-alpha.1" GeneratePathProperty="true" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src/NServiceBus.Transport.RabbitMQ.CommandLine.Tests/NServiceBus.Transport.RabbitMQ.CommandLine.Tests.csproj

Lines changed: 2 additions & 2 deletions
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
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
77
</PropertyGroup>
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
1616
<PackageReference Include="NUnit" Version="4.3.2" />
1717
<PackageReference Include="NUnit.Analyzers" Version="4.7.0" />
1818
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />

src/NServiceBus.Transport.RabbitMQ.CommandLine/BrokerConnectionBinder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ protected override BrokerConnection GetBoundValue(BindingContext bindingContext)
2828
var managementClient = new ManagementClient(connectionConfiguration, managementApiConfiguration, disableCertificateValidation);
2929
var brokerVerifier = new BrokerVerifier(managementClient, BrokerRequirementChecks.None, true);
3030

31-
var certificateCollection = new X509Certificate2Collection();
31+
X509Certificate2Collection? certificateCollection = null;
3232

33-
if (certPath != null)
33+
if (certPath is not null)
3434
{
35-
var certificate = new X509Certificate2(certPath, certPassphrase);
36-
certificateCollection.Add(certificate);
35+
certificateCollection = [CertificateLoader.LoadCertificateFromFile(certPath, certPassphrase)];
3736
}
3837

3938
var connectionFactory = new ConnectionFactory("rabbitmq-transport", connectionConfiguration, certificateCollection, disableCertificateValidation, useExternalAuth, TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(10), []);

src/NServiceBus.Transport.RabbitMQ.CommandLine/NServiceBus.Transport.RabbitMQ.CommandLine.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<ToolCommandName>rabbitmq-transport</ToolCommandName>
77
<PackAsTool>True</PackAsTool>
@@ -17,19 +17,20 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="NServiceBus" Version="9.2.7" />
20+
<PackageReference Include="NServiceBus" Version="10.0.0-alpha.1" />
2121
<PackageReference Include="RabbitMQ.Client" Version="7.1.2" />
2222
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
2323
</ItemGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Particular.Packaging" Version="4.2.2" PrivateAssets="All" />
26+
<PackageReference Include="Particular.Packaging" Version="4.3.1" PrivateAssets="All" />
2727
</ItemGroup>
2828

2929
<ItemGroup>
3030
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Administration\BrokerVerifier.cs" Link="Transport\BrokerVerifier.cs" />
3131
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Administration\ManagementApi\**\*.cs" Link="Transport\ManagementApi\%(RecursiveDir)\%(Filename)%(Extension)" />
3232
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\BrokerRequirementChecks.cs" Link="Transport\ManagementApi\BrokerRequirementChecks.cs" />
33+
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\CertificateLoader.cs" Link="Transport\CertificateLoader.cs" />
3334
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\ConnectionConfiguration.cs" Link="Transport\ConnectionConfiguration.cs" />
3435
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\ManagementApiConfiguration.cs" Link="Transport\ManagementApi\ManagementApiConfiguration.cs" />
3536
<Compile Include="..\NServiceBus.Transport.RabbitMQ\Configuration\QueueType.cs" Link="Transport\QueueType.cs" />

src/NServiceBus.Transport.RabbitMQ.Tests/BrokerVerifierTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class BrokerVerifierTests
1313
{
1414
static readonly string connectionString = Environment.GetEnvironmentVariable("RabbitMQTransport_ConnectionString") ?? "host=localhost";
1515
static readonly ConnectionConfiguration connectionConfiguration = ConnectionConfiguration.Create(connectionString);
16-
static readonly ConnectionFactory connectionFactory = new(typeof(BrokerVerifierTests).FullName, connectionConfiguration, null, false, false, TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(10), []);
16+
static readonly ConnectionFactory connectionFactory = new(typeof(BrokerVerifierTests).FullName ?? string.Empty, connectionConfiguration, null, false, false, TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(10), []);
1717

1818
[Test]
1919
public void Initialize_Should_Get_Response_When_Management_Client_Is_Available_And_Valid()

src/NServiceBus.Transport.RabbitMQ.Tests/ManagementClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ManagementClientTests
1616
{
1717
static readonly string connectionString = Environment.GetEnvironmentVariable("RabbitMQTransport_ConnectionString") ?? "host=localhost";
1818
static readonly ConnectionConfiguration connectionConfiguration = ConnectionConfiguration.Create(connectionString);
19-
static readonly ConnectionFactory connectionFactory = new(typeof(ManagementClientTests).FullName, connectionConfiguration, null, false, false, TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(10), []);
19+
static readonly ConnectionFactory connectionFactory = new(typeof(ManagementClientTests).FullName ?? string.Empty, connectionConfiguration, null, false, false, TimeSpan.FromSeconds(60), TimeSpan.FromSeconds(10), []);
2020

2121
[Test]
2222
public void Should_Pass_With_http_Scheme()

0 commit comments

Comments
 (0)