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 #6810

Merged
merged 51 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4f0ebbe
Update project files
bording Aug 8, 2023
20a3132
Remove ifdefs
bording Aug 8, 2023
1b83e3c
Update Analyzer to use latest 17.7 package
bording Aug 8, 2023
8b5617b
Fix obsolete errors
bording Aug 8, 2023
8ca51ed
Fix error
bording Aug 8, 2023
bbc0d99
Add workaround for testhost packaging error
bording Aug 8, 2023
5925d22
Bump major version
bording Aug 10, 2023
7315e77
Remove v8 obsoletes
bording Aug 10, 2023
54408c6
Move v9 obsoletes
bording Aug 10, 2023
e18fb52
Update to .NET 8 dependencies
bording Aug 10, 2023
07e69b0
Update Microsoft.NET.Test.Sdk
bording Aug 10, 2023
fb6f99e
Update workflows
bording Aug 10, 2023
bde058e
Remove init.ps1
bording Aug 10, 2023
5f55b11
Remove references to obsolete stuff
bording Aug 10, 2023
650967f
Use new di registration API
andreasohlund Aug 14, 2023
d55cc18
Remove all usages of old DI registration API
andreasohlund Aug 14, 2023
80ccc8e
Remove asserts for now obsoleted address access methods
andreasohlund Aug 14, 2023
60eeb17
IMessageCreator is no longer available in DI
andreasohlund Aug 14, 2023
3ccafbe
Add todo
andreasohlund Aug 14, 2023
e40d899
Add todo about TransactionManager.ImplicitDistributedTransactions
andreasohlund Aug 14, 2023
5327ba6
Make sure IMessageCreator is registered
andreasohlund Aug 14, 2023
f5eb924
Go back to IMessageCreator since that is what's being tested
andreasohlund Aug 14, 2023
4fd18fa
Revert test
andreasohlund Aug 14, 2023
1f01dd7
Properly register installers
andreasohlund Aug 14, 2023
1d002d2
Register interfaces
andreasohlund Aug 14, 2023
bb650ac
Approve DI changes
andreasohlund Aug 14, 2023
cdb78c3
Revert auto property change in DataBusProperty
kentdr Aug 14, 2023
40ac3f2
Remove obsolete call to InstanceSpecificQueue
kentdr Aug 14, 2023
fbc3a26
Add windows guard to dtc tests
kentdr Aug 14, 2023
f7768cb
Clean up MessageDrivenSubscriptions comment and remove reference
bording Aug 14, 2023
6d7704a
Remove unused UnitOfWork stuff
bording Aug 14, 2023
77a8513
Remove unneeded tests
bording Aug 14, 2023
a5e489b
Clean up AddAuditData references
bording Aug 14, 2023
b407bd3
Extract interface registrations to helper
andreasohlund Aug 15, 2023
d8f5bf1
Fix registration bug
andreasohlund Aug 15, 2023
6449a99
Fix feature dependency
andreasohlund Aug 15, 2023
91e8b3f
Make relevant container tests use new helper
andreasohlund Aug 15, 2023
64c97e0
Complete obsoletion of notifications
andreasohlund Aug 15, 2023
7c580d7
Fix ordering of tx scope
andreasohlund Aug 15, 2023
8ec3492
Update approval files for acceptance tests
kentdr Aug 15, 2023
78d3dc6
Remove exception test with obsolete constructor requirements
kentdr Aug 15, 2023
84c0a3d
Restore NonDurableMessage header value
bording Aug 15, 2023
855e3c7
Update PreObsoleteAttribute usage
bording Aug 15, 2023
b2419f9
Clean up TransportDefinition.ToTransportAddress
bording Aug 15, 2023
01ee2e1
Tweak Notifications obsoletes
bording Aug 15, 2023
7c736e0
Rename internal class to fix test
bording Aug 15, 2023
41e961b
Update approval files
bording Aug 15, 2023
a3b791e
Remove binding redirect stuff from AssemblyScanner error messages
bording Aug 15, 2023
d35686b
Update PreObsolete issue link
bording Aug 16, 2023
1b9907d
Update PreObsoleteAttribute XML comment
bording Aug 16, 2023
f88ce81
Get rid of AddWithInterfaces
andreasohlund Aug 17, 2023
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
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<PropertyGroup>
<MinVerMinimumMajorMinor>8.1</MinVerMinimumMajorMinor>
<MinVerMinimumMajorMinor>9.0</MinVerMinimumMajorMinor>
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ class AcceptanceTestingSubscriptionPersistence : Feature
{
public AcceptanceTestingSubscriptionPersistence()
{
#pragma warning disable CS0618
DependsOn<MessageDrivenSubscriptions>();
#pragma warning restore CS0618
DependsOn("NServiceBus.Features.MessageDrivenSubscriptions");
}

protected internal override void Setup(FeatureConfigurationContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
Expand All @@ -27,34 +26,10 @@ public override async Task<TransportInfrastructure> Initialize(HostSettings host
return infrastructure;
}

[Obsolete("Obsolete marker to make the code compile", false)]
[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address)
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
{
var baseAddress = address.BaseAddress;
ThrowForBadPath(baseAddress, "endpoint name");

var discriminator = address.Discriminator;

if (!string.IsNullOrEmpty(discriminator))
{
ThrowForBadPath(discriminator, "endpoint discriminator");

baseAddress += "-" + discriminator;
}

var qualifier = address.Qualifier;

if (!string.IsNullOrEmpty(qualifier))
{
ThrowForBadPath(qualifier, "address qualifier");

baseAddress += "-" + qualifier;
}

return baseAddress;
}

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
Expand All @@ -67,6 +42,7 @@ public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransa
}

string storageLocation;

public string StorageLocation
{
get => storageLocation;
Expand All @@ -77,22 +53,5 @@ public string StorageLocation
storageLocation = value;
}
}

static void ThrowForBadPath(string value, string valueName)
{
var invalidPathChars = Path.GetInvalidPathChars();

if (string.IsNullOrEmpty(value))
{
return;
}

if (value.IndexOfAny(invalidPathChars) < 0)
{
return;
}

throw new Exception($"The value for '{valueName}' has illegal path characters. Provided value: {value}. Must not contain any of {string.Join(", ", invalidPathChars)}.");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\NServiceBus.snk</AssemblyOriginatorKeyFile>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

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

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System.Transactions" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="[3.13.3, 4.0.0)" />
<PackageReference Include="Particular.Packaging" Version="3.0.0" PrivateAssets="All" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace NServiceBus.AcceptanceTesting
{
using System;
using System.Runtime.Serialization;

/// <summary>
/// A dummy exception to be used in acceptance tests for easier differentiation from real exceptions.
Expand All @@ -19,9 +18,5 @@ public SimulatedException(string message) : base(message)
public SimulatedException(string message, Exception innerException) : base(message, innerException)
{
}

protected SimulatedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.ISubscriptionStorag
----------- Public registrations not used by Core -----------
NServiceBus.CriticalError - Singleton
NServiceBus.Hosting.HostInformation - Singleton
NServiceBus.IHandleMessages`1[[NServiceBus.AcceptanceTests.Core.DependencyInjection.When_endpoint_is_warmed_up+SomeMessage, NServiceBus.AcceptanceTests, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null]] - Scoped
NServiceBus.IMessageCreator - Singleton
NServiceBus.MessageInterfaces.IMessageMapper - Singleton
NServiceBus.Notifications - Singleton
NServiceBus.Persistence.ISynchronizedStorageSession - Scoped
NServiceBus.Pipeline.IBehavior - Transient
NServiceBus.Pipeline.IBehavior`2[[NServiceBus.Pipeline.IIncomingLogicalMessageContext, NServiceBus.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c],[NServiceBus.Pipeline.IIncomingLogicalMessageContext, NServiceBus.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] - Transient
NServiceBus.Pipeline.IBehavior`2[[NServiceBus.Pipeline.IIncomingPhysicalMessageContext, NServiceBus.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c],[NServiceBus.Pipeline.IIncomingPhysicalMessageContext, NServiceBus.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c]] - Transient
NServiceBus.Pipeline.LogicalMessageFactory - Singleton
NServiceBus.Settings.IReadOnlySettings - Singleton
NServiceBus.Transport.ISubscriptionManager - Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@
(IIncomingPhysicalMessageContext context3) => ProcessingStatisticsBehavior.Invoke(context3,
(IIncomingPhysicalMessageContext context4) => MutateIncomingTransportMessageBehavior.Invoke(context4,
(IIncomingPhysicalMessageContext context5) => SubscriptionReceiverBehavior.Invoke(context5,
(IIncomingPhysicalMessageContext context6) => UnitOfWorkBehavior.Invoke(context6,
(IIncomingPhysicalMessageContext context7) => DeserializeMessageConnector.Invoke(context7,
(IIncomingLogicalMessageContext context8) => MutateIncomingMessageBehavior.Invoke(context8,
(IIncomingLogicalMessageContext context9) => InferredMessageTypeEnricherBehavior.Invoke(context9,
(IIncomingLogicalMessageContext context10) => LoadHandlersConnector.Invoke(context10,
(IInvokeHandlerContext context11) => InvokeHandlerTerminator.Invoke(context11))
(IIncomingPhysicalMessageContext context6) => DeserializeMessageConnector.Invoke(context6,
(IIncomingLogicalMessageContext context7) => MutateIncomingMessageBehavior.Invoke(context7,
(IIncomingLogicalMessageContext context8) => InferredMessageTypeEnricherBehavior.Invoke(context8,
(IIncomingLogicalMessageContext context9) => LoadHandlersConnector.Invoke(context9,
(IInvokeHandlerContext context10) => InvokeHandlerTerminator.Invoke(context10))

(IRecoverabilityContext context0) => CaptureRecoverabilityActionBehavior.Invoke(context0,
(IRecoverabilityContext context1) => RecoverabilityRoutingConnector.Invoke(context1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ public override Task<TransportInfrastructure> Initialize(HostSettings hostSettin
return Task.FromResult<TransportInfrastructure>(infrastructure);
}

[Obsolete("Obsolete marker to make the code compile", false)]
[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address)
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
{
return new LearningTransport().ToTransportAddress(address);
}

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,10 @@ public override Task<TransportInfrastructure> Initialize(HostSettings hostSettin
return Task.FromResult<TransportInfrastructure>(new FakeTransportInfrastructure(receivers));
}

[Obsolete("Obsolete marker to make the code compile", false)]
[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address)
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member
{
return address.ToString();
}

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ public interface IMyReply : IMessage
{
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,10 @@ public Endpoint()

public class StartMessageHandler : IHandleMessages<StartMessage>
{
public StartMessageHandler(IMessageCreator messageCreator)
{
this.messageCreator = messageCreator;
}

public Task Handle(StartMessage message, IMessageHandlerContext context)
{
var interfaceMessage = messageCreator.CreateInstance<IMyMessage>();
return context.Send(interfaceMessage);
return context.Send<IMyMessage>(_ => { });
}

IMessageCreator messageCreator;
}

public class MyMessageHandler : IHandleMessages<IMyMessage>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
namespace NServiceBus.AcceptanceTests.Core.TransportSeam
{
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using AcceptanceTesting;
using EndpointTemplates;
using Features;
using NServiceBus.Configuration.AdvancedExtensibility;
using NServiceBus.Transport;
using NUnit.Framework;

Expand All @@ -25,9 +23,7 @@ public async Task Should_provide_access_to_addresses_and_address_resolution()

Assert.AreEqual("SomeAddress", context.ResolvedAddress);
Assert.AreEqual(endpointName, context.ReceiveAddresses.MainReceiveAddress);
Assert.AreEqual(context.LocalAddress, context.ReceiveAddresses.MainReceiveAddress);
Assert.AreEqual(endpointName + "-MyInstance", context.ReceiveAddresses.InstanceReceiveAddress);
Assert.AreEqual(context.InstanceSpecificQueue, context.ReceiveAddresses.InstanceReceiveAddress);
Assert.AreEqual("MySatellite", context.ReceiveAddresses.SatelliteReceiveAddresses.Single());
Assert.AreEqual(endpointName, context.LocalQueueAddress.ToString());
Assert.AreEqual(endpointName + "-MyInstance", context.InstanceSpecificQueueAddress.ToString());
Expand All @@ -37,8 +33,6 @@ class Context : ScenarioContext
{
public string ResolvedAddress { get; set; }
public ReceiveAddresses ReceiveAddresses { get; set; }
public string LocalAddress { get; set; }
public string InstanceSpecificQueue { get; set; }
public QueueAddress LocalQueueAddress { get; set; }
public QueueAddress InstanceSpecificQueueAddress { get; set; }
}
Expand All @@ -49,13 +43,6 @@ public Endpoint()
{
EndpointSetup<DefaultServer>(c =>
{
#pragma warning disable IDE0079
#pragma warning disable CS0618
Assert.Throws<InvalidOperationException>(() => c.GetSettings().LocalAddress(), "Should throw since the endpoint isn't configured yet");
Assert.Throws<InvalidOperationException>(() => c.GetSettings().InstanceSpecificQueue(), "Should throw since the endpoint isn't configured yet");
#pragma warning restore CS0618
#pragma warning restore IDE0079

c.EnableFeature<FeatureAccessingAddressing>();
c.MakeInstanceUniquelyAddressable("MyInstance");
});
Expand All @@ -67,13 +54,6 @@ protected override void Setup(FeatureConfigurationContext context)
{
var testContext = (Context)context.Settings.Get<ScenarioContext>();

#pragma warning disable IDE0079
#pragma warning disable CS0618
testContext.LocalAddress = context.Settings.LocalAddress();
testContext.InstanceSpecificQueue = context.Settings.InstanceSpecificQueue();
#pragma warning restore CS0618
#pragma warning restore IDE0079

testContext.LocalQueueAddress = context.LocalQueueAddress();
testContext.InstanceSpecificQueueAddress = context.InstanceSpecificQueueAddress();

Expand Down
Loading