Skip to content

Commit

Permalink
Update for .NET 9 - release-9.2 (#7236)
Browse files Browse the repository at this point in the history
* Updates for .NET 9

Co-authored-by: internalautomation[bot] <85681268+internalautomation[bot]@users.noreply.github.com>
Co-authored-by: Jayanthi <jayanthi.sourirajan@particular.net>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent 3adcd33 commit 841c90e
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 41 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.0.1
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 8.0.x
dotnet-version: |
9.0.x
8.0.x
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
if: matrix.name == 'Windows'
uses: actions/upload-artifact@v4.3.5
uses: actions/upload-artifact@v4.4.3
with:
name: NuGet packages
path: nugets/
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4.0.1
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand All @@ -32,7 +32,7 @@ jobs:
client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}
certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }}
- name: Publish artifacts
uses: actions/upload-artifact@v4.3.5
uses: actions/upload-artifact@v4.4.3
with:
name: nugets
path: nugets/*
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.400",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Context : ScenarioContext
public string IncomingMessageId { get; set; }
public string IncomingMessageConversationId { get; set; }
public bool IncomingMessageReceived { get; set; }
public IReadOnlyDictionary<string, string> ReceivedHeaders { get; set; }
public Dictionary<string, string> ReceivedHeaders { get; set; }
public string IncomingNativeMessageId { get; set; }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -117,7 +116,7 @@ class Context : ScenarioContext
public bool OutgoingMessageReceived { get; set; }
public string SentMessageId { get; set; }
public string MessageConversationId { get; set; }
public IReadOnlyDictionary<string, string> SentMessageHeaders { get; set; }
public Dictionary<string, string> SentMessageHeaders { get; set; }
}


Expand All @@ -136,7 +135,7 @@ public Task Handle(OutgoingMessage message, IMessageHandlerContext context)
testContext.SentMessageId = context.MessageId;
testContext.MessageConversationId = context.MessageHeaders[Headers.ConversationId];
testContext.OutgoingMessageReceived = true;
testContext.SentMessageHeaders = new ReadOnlyDictionary<string, string>((IDictionary<string, string>)context.MessageHeaders);
testContext.SentMessageHeaders = new Dictionary<string, string>((IDictionary<string, string>)context.MessageHeaders);
return Task.CompletedTask;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Context : ScenarioContext
{
public bool MessageReceived { get; set; }
public string MessageId { get; set; }
public IReadOnlyDictionary<string, string> Headers { get; set; }
public Dictionary<string, string> Headers { get; set; }
}

class Endpoint : EndpointConfigurationBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" PrivateAssets="All" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="All" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" PrivateAssets="All" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="Particular.Approvals" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="4.2.0" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -12,9 +12,9 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,9 +15,9 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -13,10 +13,10 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NuDoq" Version="2.0.1" NoWarn="NU1701" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Particular.Approvals" Version="2.0.0" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void Should_throw_friendly_exception_if_handler_returns_null()
Assert.That(async () => await terminator.Invoke(behaviorContext, _ => Task.CompletedTask), Throws.Exception.With.Message.EqualTo("Return a Task or mark the method as async."));
}

static ActiveSagaInstance AssociateSagaWithMessage(FakeSaga saga, IInvokeHandlerContext behaviorContext)
static ActiveSagaInstance AssociateSagaWithMessage(FakeSaga saga, TestableInvokeHandlerContext behaviorContext)
{
var sagaInstance = new ActiveSagaInstance(saga, SagaMetadata.Create(typeof(FakeSaga), [], new Conventions()), () => DateTime.UtcNow);
behaviorContext.Extensions.Set(sagaInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void Should_handle_concrete_message_with_interface_property()
[Test]
public void Should_handle_interface_message_with_interface_property()
{
IMessageWithInterfaceProperty message = new InterfaceMessageWithInterfacePropertyImplementation
var message = new InterfaceMessageWithInterfacePropertyImplementation
{
InterfaceProperty = new InterfacePropertyImplementation
{
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus.Core/Serialization/SerializationFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ static IMessageSerializer CreateMessageSerializer(Tuple<SerializationDefinition,
return serializer;
}

static void LogFoundMessages(IReadOnlyCollection<MessageMetadata> messageDefinitions)
static void LogFoundMessages(MessageMetadata[] messageDefinitions)
{
if (!Logger.IsInfoEnabled)
{
return;
}
Logger.DebugFormat("Number of messages found: {0}", messageDefinitions.Count);
Logger.DebugFormat("Number of messages found: {0}", messageDefinitions.Length);
if (!Logger.IsDebugEnabled)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Core/Serializers/XML/XmlDeserialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static string GetNameAfterColon(string name)
string defaultNamespace;
readonly IMessageMapper mapper;
readonly List<Type> messageBaseTypes = [];
readonly IDictionary<string, string> prefixesToNamespaces = new Dictionary<string, string>();
readonly Dictionary<string, string> prefixesToNamespaces = [];
readonly bool sanitizeInput;
readonly bool skipWrappingRawXml;

Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Core/Serializers/XML/XmlSerialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static bool IsIndexedProperty(PropertyInfo propertyInfo)
return propertyInfo?.GetIndexParameters().Length > 0;
}

static void WriteElementNamespaces(XElement elem, IReadOnlyList<string> baseTypes)
static void WriteElementNamespaces(XElement elem, List<string> baseTypes)
{
elem.Add(new XAttribute(XNamespace.Xmlns + "xsi", xsiNamespace),
new XAttribute(XNamespace.Xmlns + "xsd", xsdNamespace));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,8 +11,8 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Particular.Approvals" Version="2.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Expand All @@ -12,9 +12,9 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="All" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" PrivateAssets="All" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" PrivateAssets="All" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="4.2.0" PrivateAssets="All" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,9 +10,9 @@

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="All" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0" PrivateAssets="All" />
<PackageReference Include="NUnit.Analyzers" Version="4.4.0" PrivateAssets="All" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="Particular.Packaging" Version="4.2.0" PrivateAssets="All" />
</ItemGroup>
Expand Down

0 comments on commit 841c90e

Please sign in to comment.