Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare repo for .NET 8 #410

Merged
merged 4 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
strategy:
matrix:
include:
- os: windows-2019
- os: windows-2022
name: Windows
- os: ubuntu-20.04
- os: ubuntu-22.04
name: Linux
fail-fast: false
steps:
Expand All @@ -28,9 +28,8 @@ jobs:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: |
7.0.x
6.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
DOTNET_NOLOGO: true
jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -17,7 +17,8 @@ jobs:
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: Build
run: dotnet build src --configuration Release
- name: Sign NuGet packages
Expand Down
2 changes: 1 addition & 1 deletion src/Custom.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<MinVerMinimumMajorMinor>4.1</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>5.0</MinVerMinimumMajorMinor>
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task<EndpointConfiguration> GetConfiguration(RunDescriptor runDescr
recoverability.Delayed(delayed => delayed.NumberOfRetries(0));
recoverability.Immediate(immediate => immediate.NumberOfRetries(0));
configuration.SendFailedMessagesTo("error");
configuration.UseSerialization<NewtonsoftJsonSerializer>();
configuration.UseSerialization<SystemJsonSerializer>();

await configuration.DefineTransport(runDescriptor, endpointConfiguration).ConfigureAwait(false);

Expand Down
16 changes: 7 additions & 9 deletions src/NServiceBus.Heartbeat.AcceptanceTests/InMemoryTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,29 @@ public Task Dispatch(TransportOperations outgoingMessages, TransportTransaction
}

public override Task Shutdown(CancellationToken cancellationToken = default) => Task.CompletedTask;
#pragma warning disable CS0618
public override string ToTransportAddress(QueueAddress address) => transport.ToTransportAddress(address);
#pragma warning restore CS0618

public override string ToTransportAddress(QueueAddress address) => address.ToString();
}

public InMemoryTransport() : base(TransportTransactionMode.None, true, true, true)
{
}

#pragma warning disable 1998
public override async Task<TransportInfrastructure> Initialize(HostSettings hostSettings, ReceiveSettings[] receivers,
#pragma warning restore 1998
public override Task<TransportInfrastructure> Initialize(HostSettings hostSettings, ReceiveSettings[] receivers,
string[] sendingAddresses,
CancellationToken cancellationToken = default)
{
var infrastructure = new InMemTransportInfrastructure(this);
infrastructure.Initialize();

return infrastructure;
return Task.FromResult<TransportInfrastructure>(infrastructure);
}

[Obsolete("Inject the ITransportAddressResolver type to access the address translation mechanism at runtime. See the NServiceBus version 8 upgrade guide for further details. Will be treated as an error from version 9.0.0. Will be removed in version 10.0.0.", false)]
public override string ToTransportAddress(QueueAddress address) => address.BaseAddress;

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes() =>
new[] { TransportTransactionMode.None };

[Obsolete("Inject the ITransportAddressResolver type to access the address translation mechanism at runtime. See the NServiceBus version 8 upgrade guide for further details.")]
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Heartbeat\NServiceBus.Heartbeat.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="8.1.1" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="3.0.0" />
<PackageReference Include="NServiceBus.AcceptanceTesting" Version="9.0.0-alpha.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ public abstract partial class NServiceBusAcceptanceTest
[SetUp]
public void SetUp()
{
#if NET452
// Hack: prevents SerializationException ... Type 'x' in assembly 'y' is not marked as serializable.
// https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/mitigation-deserialization-of-objects-across-app-domains
System.Configuration.ConfigurationManager.GetSection("X");
#endif
Conventions.EndpointNamingConvention = t =>
{
var classAndEndpoint = t.FullName.Split('.').Last();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"NServiceBus.Heartbeat.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dde965e6172e019ac82c2639ffe494dd2e7dd16347c34762a05732b492e110f2e4e2e1b5ef2d85c848ccfb671ee20a47c8d1376276708dc30a90ff1121b647ba3b7259a6bc383b2034938ef0e275b58b920375ac605076178123693c6c4f1331661a62eba28c249386855637780e3ff5f23a6d854700eaa6803ef48907513b92")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"NServiceBus.Heartbeat.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001007f16e21368ff041183fab592d9e8ed37e7be355e93323147a1d29983d6e591b04282e4da0c9e18bd901e112c0033925eb7d7872c2f1706655891c5c9d57297994f707d16ee9a8f40d978f064ee1ffc73c0db3f4712691b23bf596f75130f4ec978cf78757ec034625a5f27e6bb50c618931ea49f6f628fd74271c32959efb1c5")]
namespace NServiceBus
{
public static class HeartbeatConfigurationExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0;net7.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBus.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBusTests.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NServiceBus.Heartbeat\NServiceBus.Heartbeat.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="NServiceBus" Version="8.1.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0-preview-23424-02" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
Expand Down
2 changes: 2 additions & 0 deletions src/NServiceBus.Heartbeat.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Heartbeat.Tests
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5DB5F908-82DA-42E3-9724-9BEE35E63D18}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
Custom.Build.props = Custom.Build.props
..\.github\workflows\release.yml = ..\.github\workflows\release.yml
EndProjectSection
EndProject
Global
Expand Down
3 changes: 0 additions & 3 deletions src/NServiceBus.Heartbeat/InternalsVisibleTo.cs

This file was deleted.

11 changes: 6 additions & 5 deletions src/NServiceBus.Heartbeat/NServiceBus.Heartbeat.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SolutionDir)NServiceBus.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup>
<Description>Send heartbeat monitoring messages from NServiceBus endpoints</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NServiceBus" Version="[8.0.3, 9.0.0)" />
<PackageReference Include="NServiceBus" Version="9.0.0-alpha.1" />
bording marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
<PackageReference Include="Particular.Packaging" Version="3.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="NServiceBus.Heartbeat.Tests" Key="$(NServiceBusTestsKey)" />
</ItemGroup>

</Project>