diff --git a/src/Custom.Build.props b/src/Custom.Build.props index 6dd6b92938..cc50dc8d6f 100644 --- a/src/Custom.Build.props +++ b/src/Custom.Build.props @@ -16,4 +16,8 @@ minor + + + + diff --git a/src/NServiceBus.AcceptanceTests/Outbox/When_a_message_is_audited.cs b/src/NServiceBus.AcceptanceTests/Outbox/When_a_message_is_audited.cs index f34687b3ba..b9a0c7af77 100644 --- a/src/NServiceBus.AcceptanceTests/Outbox/When_a_message_is_audited.cs +++ b/src/NServiceBus.AcceptanceTests/Outbox/When_a_message_is_audited.cs @@ -47,7 +47,7 @@ class BlowUpAfterDispatchBehavior : IBehavior next) { - if (!context.Operations.Any(op => op.Message.Headers[Headers.EnclosedMessageTypes].Contains(nameof(When_a_message_is_audited.MessageToBeAudited)))) + if (!context.Operations.Any(op => op.Message.Headers[Headers.EnclosedMessageTypes].Contains(nameof(MessageToBeAudited)))) { await next(context).ConfigureAwait(false); return; diff --git a/src/NServiceBus.Core.Analyzer.Tests.Roslyn5/Handlers/HandlerAttributeFixerTests.cs b/src/NServiceBus.Core.Analyzer.Tests.Roslyn5/Handlers/HandlerAttributeFixerTests.cs index c9574208b2..2161dbef05 100644 --- a/src/NServiceBus.Core.Analyzer.Tests.Roslyn5/Handlers/HandlerAttributeFixerTests.cs +++ b/src/NServiceBus.Core.Analyzer.Tests.Roslyn5/Handlers/HandlerAttributeFixerTests.cs @@ -60,7 +60,7 @@ class NonHandler } """; - NUnit.Framework.Assert.That(async () => await base.Assert(original, expected), Throws.Exception); + NUnit.Framework.Assert.That(async () => await Assert(original, expected), Throws.Exception); } [Test] diff --git a/src/NServiceBus.Core.Analyzer/Handlers/Handlers.Parser.cs b/src/NServiceBus.Core.Analyzer/Handlers/Handlers.Parser.cs index 7f74f0c59d..05751ee6b8 100644 --- a/src/NServiceBus.Core.Analyzer/Handlers/Handlers.Parser.cs +++ b/src/NServiceBus.Core.Analyzer/Handlers/Handlers.Parser.cs @@ -365,9 +365,9 @@ static string BuildAdapterName(INamedTypeSymbol handlerType, IMethodSymbol metho // Simple name parts: declaring type class name chain + message type class name var displayParts = handlerType.ToDisplayParts(SymbolDisplayFormat.FullyQualifiedFormat); - var typeName = string.Join("__", displayParts.Where(x => x.Kind == Microsoft.CodeAnalysis.SymbolDisplayPartKind.ClassName)); + var typeName = string.Join("__", displayParts.Where(x => x.Kind == SymbolDisplayPartKind.ClassName)); var messageParts = method.Parameters[0].Type.ToDisplayParts(SymbolDisplayFormat.FullyQualifiedFormat); - var messageName = string.Join("__", messageParts.Where(x => x.Kind == Microsoft.CodeAnalysis.SymbolDisplayPartKind.ClassName)); + var messageName = string.Join("__", messageParts.Where(x => x.Kind == SymbolDisplayPartKind.ClassName)); return $"{typeName}__Handle__{messageName}_{hash:x16}"; } diff --git a/src/NServiceBus.Core.Analyzer/NServiceBus.Core.Analyzer.csproj b/src/NServiceBus.Core.Analyzer/NServiceBus.Core.Analyzer.csproj index 30304ac6bc..0d9456f8ca 100644 --- a/src/NServiceBus.Core.Analyzer/NServiceBus.Core.Analyzer.csproj +++ b/src/NServiceBus.Core.Analyzer/NServiceBus.Core.Analyzer.csproj @@ -24,11 +24,4 @@ - - - - $([System.Text.RegularExpressions.Regex]::Replace('%(Filename)', '\..*$', '')).cs - - - diff --git a/src/NServiceBus.Core.Tests/ApprovalFiles/APIApprovals.ApproveNServiceBus.approved.txt b/src/NServiceBus.Core.Tests/ApprovalFiles/APIApprovals.ApproveNServiceBus.approved.txt index c0deb54667..abaf82cd0f 100644 --- a/src/NServiceBus.Core.Tests/ApprovalFiles/APIApprovals.ApproveNServiceBus.approved.txt +++ b/src/NServiceBus.Core.Tests/ApprovalFiles/APIApprovals.ApproveNServiceBus.approved.txt @@ -264,12 +264,12 @@ namespace NServiceBus Send = 0, Publish = 1, } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class Endpoint { - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static System.Threading.Tasks.Task Create(NServiceBus.EndpointConfiguration configuration, System.Threading.CancellationToken cancellationToken = default) { } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static System.Threading.Tasks.Task Start(NServiceBus.EndpointConfiguration configuration, System.Threading.CancellationToken cancellationToken = default) { } } public class EndpointConfiguration : NServiceBus.Configuration.AdvancedExtensibility.ExposeSettings @@ -277,7 +277,7 @@ namespace NServiceBus public EndpointConfiguration(string endpointName) { } public NServiceBus.Pipeline.PipelineSettings Pipeline { get; } public NServiceBus.ConventionsBuilder Conventions() { } - [System.Obsolete(@"Registering services via RegisterComponents is not recommended. For a single endpoint, register services directly on the host builder's IServiceCollection. When hosting multiple endpoints via AddNServiceBusEndpoint, use keyed service registrations with the endpointIdentifier as the key. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"RegisterComponents should only be used when self-hosting endpoints, which is no longer recommended. When using a Microsoft IHostApplicationBuilder-based host, register services directly on the host builder's IServiceCollection. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public void RegisterComponents(System.Action registration) { } public void SendOnly() { } } @@ -294,16 +294,16 @@ namespace NServiceBus public static void EnableFeature(this NServiceBus.EndpointConfiguration config) where TFeature : NServiceBus.Features.Feature, new () { } } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class EndpointInstanceExtensions { - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static System.Threading.Tasks.Task Stop(this NServiceBus.IEndpointInstance endpoint, System.TimeSpan gracefulStopTimeout) { } } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class EndpointWithExternallyManagedContainer { - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static NServiceBus.IStartableEndpointWithExternallyManagedContainer Create(NServiceBus.EndpointConfiguration configuration, Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection) { } } public static class EnvelopeConfigExtensions @@ -486,10 +486,10 @@ namespace NServiceBus { NServiceBus.Routing.DistributionStrategy GetDistributionStrategy(string endpointName, NServiceBus.DistributionStrategyScope scope); } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IEndpointInstance : NServiceBus.IMessageSession { - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] System.Threading.Tasks.Task Stop(System.Threading.CancellationToken cancellationToken = default); } public interface IEnvelopeHandler @@ -556,20 +556,20 @@ namespace NServiceBus { System.Threading.Tasks.Task Handle(object message, NServiceBus.IMessageProcessingContext context); } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IStartableEndpoint { - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] System.Threading.Tasks.Task Start(System.Threading.CancellationToken cancellationToken = default); } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IStartableEndpointWithExternallyManagedContainer { [System.Obsolete("The message session is automatically registered in the service collection and no " + "longer needs to be manually registered. Will be treated as an error from version" + " 11.0.0. Will be removed in version 12.0.0.", false)] System.Lazy MessageSession { get; } - [System.Obsolete(@"Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] System.Threading.Tasks.Task Start(System.IServiceProvider builder, System.Threading.CancellationToken cancellationToken = default); } [System.Obsolete("The old saga mapping API has been obsoleted, use \'mapper.MapSaga(...)\' instead. W" + @@ -1589,17 +1589,16 @@ namespace NServiceBus.Installation } namespace NServiceBus.Logging { - [System.Obsolete("Use services.Configure() to configure the built-in " + - "rolling file logging provider. Will be treated as an error from version 11.0.0. " + - "Will be removed in version 12.0.0.", false)] + [System.Obsolete("Use \'IServiceCollection.Configure()\' instead. Will " + + "be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public class DefaultFactory : NServiceBus.Logging.LoggingFactoryDefinition { public DefaultFactory() { } - [System.Obsolete("Set RollingLoggerProviderOptions.Directory instead. Will be treated as an error f" + - "rom version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete("Use \'RollingLoggerProviderOptions.Directory\' instead. Will be treated as an error" + + " from version 11.0.0. Will be removed in version 12.0.0.", false)] public void Directory(string directory) { } protected override NServiceBus.Logging.ILoggerFactory GetLoggingFactory() { } - [System.Obsolete(@"Set RollingLoggerProviderOptions.LogLevel instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete(@"Use 'RollingLoggerProviderOptions.LogLevel' instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public void Level(NServiceBus.Logging.LogLevel level) { } } public interface ILog @@ -1643,18 +1642,17 @@ namespace NServiceBus.Logging public static NServiceBus.Logging.ILog GetLogger(System.Type type) { } public static NServiceBus.Logging.ILog GetLogger(string name) { } public static NServiceBus.Logging.ILog GetLogger() { } - [System.Obsolete("Use services.Configure() to configure the built-in " + - "rolling file logging provider. Will be treated as an error from version 11.0.0. " + - "Will be removed in version 12.0.0.", false)] + [System.Obsolete("Configure logging through Microsoft.Extensions.Logging instead. Will be treated a" + + "s an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static T Use() where T : NServiceBus.Logging.LoggingFactoryDefinition, new () { } - [System.Obsolete("Configure logging through Microsoft.Extensions.Logging directly. Will be treated " + - "as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete("Configure logging through Microsoft.Extensions.Logging instead. Will be treated a" + + "s an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static void UseFactory(NServiceBus.Logging.ILoggerFactory loggerFactory) { } } - [System.Obsolete("Implement Microsoft.Extensions.Logging.ILoggerProvider directly and register via " + - "services.AddSingleton(). Will be treated as an er" + - "ror from version 11.0.0. Will be removed in version 12.0.0.", false)] + [System.Obsolete("Implement a custom logger using Microsoft.Extensions.Logging.ILoggerProvider inst" + + "ead. Will be treated as an error from version 11.0.0. Will be removed in version" + + " 12.0.0.", false)] public abstract class LoggingFactoryDefinition { protected LoggingFactoryDefinition() { } @@ -2609,9 +2607,8 @@ namespace NServiceBus.Unicast public System.Collections.Generic.IEnumerable GetMessageTypes() { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Registering handlers using assembly scanning is not supported in trimming scenari" + "os.")] - [System.Obsolete("Deprecated in favor of a strongly-typed alternative. Use \'AddHandler()\'" + - " instead. Will be treated as an error from version 11.0.0. Will be removed in ve" + - "rsion 12.0.0.", false)] + [System.Obsolete("Use \'AddHandler()\' instead. Will be treated as an error from version 11" + + ".0.0. Will be removed in version 12.0.0.", false)] public void RegisterHandler(System.Type handlerType) { } } public class MessagesEventArgs : System.EventArgs diff --git a/src/NServiceBus.Core/Endpoint.cs b/src/NServiceBus.Core/Endpoint.cs index bff4a2f744..284c4638fe 100644 --- a/src/NServiceBus.Core/Endpoint.cs +++ b/src/NServiceBus.Core/Endpoint.cs @@ -14,11 +14,11 @@ namespace NServiceBus; /// Provides factory methods for creating and starting endpoint instances. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class Endpoint { /// @@ -27,11 +27,11 @@ public static class Endpoint /// Configuration. /// A to observe. [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static async Task Create(EndpointConfiguration configuration, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(configuration); @@ -55,11 +55,11 @@ public static async Task Create(EndpointConfiguration config /// Configuration. /// A to observe. [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static async Task Start(EndpointConfiguration configuration, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(configuration); diff --git a/src/NServiceBus.Core/EndpointConfiguration.cs b/src/NServiceBus.Core/EndpointConfiguration.cs index f296caae60..9a5bdac291 100644 --- a/src/NServiceBus.Core/EndpointConfiguration.cs +++ b/src/NServiceBus.Core/EndpointConfiguration.cs @@ -82,10 +82,10 @@ public EndpointConfiguration(string endpointName) /// Used to configure components in the container. /// [ObsoleteMetadata( - Message = "Registering services via RegisterComponents is not recommended. For a single endpoint, register services directly on the host builder's IServiceCollection. When hosting multiple endpoints via AddNServiceBusEndpoint, use keyed service registrations with the endpointIdentifier as the key", + Message = "RegisterComponents should only be used when self-hosting endpoints, which is no longer recommended. When using a Microsoft IHostApplicationBuilder-based host, register services directly on the host builder's IServiceCollection", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] - [Obsolete("Registering services via RegisterComponents is not recommended. For a single endpoint, register services directly on the host builder's IServiceCollection. When hosting multiple endpoints via AddNServiceBusEndpoint, use keyed service registrations with the endpointIdentifier as the key. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("RegisterComponents should only be used when self-hosting endpoints, which is no longer recommended. When using a Microsoft IHostApplicationBuilder-based host, register services directly on the host builder's IServiceCollection. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public void RegisterComponents(Action registration) { ArgumentNullException.ThrowIfNull(registration); diff --git a/src/NServiceBus.Core/EndpointCreator.cs b/src/NServiceBus.Core/EndpointCreator.cs index 17fd9992b4..780c13f93a 100644 --- a/src/NServiceBus.Core/EndpointCreator.cs +++ b/src/NServiceBus.Core/EndpointCreator.cs @@ -31,7 +31,7 @@ public static EndpointCreator Create(EndpointConfiguration endpointConfiguration settings.PreventReuse(); var endpointLogSlot = settings.Get().GetOrCreateEndpointLogSlot(); - using var _ = Logging.LogManager.BeginSlotScope(endpointLogSlot); + using var _ = LogManager.BeginSlotScope(endpointLogSlot); var assemblyScanningConfiguration = settings.Get(); var assemblyScanningComponent = AssemblyScanningComponent.Initialize(assemblyScanningConfiguration, settings); diff --git a/src/NServiceBus.Core/EndpointInstanceExtensions.cs b/src/NServiceBus.Core/EndpointInstanceExtensions.cs index 5cd764ff48..6b62b233d0 100644 --- a/src/NServiceBus.Core/EndpointInstanceExtensions.cs +++ b/src/NServiceBus.Core/EndpointInstanceExtensions.cs @@ -10,11 +10,11 @@ namespace NServiceBus; /// Extensions for . /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class EndpointInstanceExtensions { /// @@ -24,12 +24,12 @@ public static class EndpointInstanceExtensions /// The endpoint to stop. /// The length of time granted to gracefully complete processing. [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] [SuppressMessage("Code", "PS0018:A task-returning method should have a CancellationToken parameter unless it has a parameter implementing ICancellableContext", Justification = "Convenience method wrapping the CancellationToken overload.")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static async Task Stop(this IEndpointInstance endpoint, TimeSpan gracefulStopTimeout) { using var cancellationTokenSource = new CancellationTokenSource(gracefulStopTimeout); diff --git a/src/NServiceBus.Core/EndpointWithExternallyManagedContainer.cs b/src/NServiceBus.Core/EndpointWithExternallyManagedContainer.cs index 90797f1759..76f6235c03 100644 --- a/src/NServiceBus.Core/EndpointWithExternallyManagedContainer.cs +++ b/src/NServiceBus.Core/EndpointWithExternallyManagedContainer.cs @@ -8,22 +8,22 @@ namespace NServiceBus; /// Provides factory methods for creating endpoints instances with an externally managed container. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpointt. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static class EndpointWithExternallyManagedContainer { /// /// Creates a new startable endpoint based on the provided configuration that uses an externally managed container. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static IStartableEndpointWithExternallyManagedContainer Create(EndpointConfiguration configuration, IServiceCollection serviceCollection) { ArgumentNullException.ThrowIfNull(configuration); diff --git a/src/NServiceBus.Core/IEndpointInstance.cs b/src/NServiceBus.Core/IEndpointInstance.cs index 5b54eea088..b8c7c43a90 100644 --- a/src/NServiceBus.Core/IEndpointInstance.cs +++ b/src/NServiceBus.Core/IEndpointInstance.cs @@ -11,21 +11,21 @@ namespace NServiceBus; /// Represents an endpoint in the running phase. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IEndpointInstance : IMessageSession { /// /// Stops the endpoint. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] Task Stop(CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/src/NServiceBus.Core/IStartableEndpoint.cs b/src/NServiceBus.Core/IStartableEndpoint.cs index 2c0eaa5bac..01563ab584 100644 --- a/src/NServiceBus.Core/IStartableEndpoint.cs +++ b/src/NServiceBus.Core/IStartableEndpoint.cs @@ -11,11 +11,11 @@ namespace NServiceBus; /// Represents an endpoint in the start-up phase. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IStartableEndpoint { /// @@ -23,10 +23,10 @@ public interface IStartableEndpoint /// /// A reference to the endpoint. [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] Task Start(CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/src/NServiceBus.Core/IStartableEndpointWithExternallyManagedContainer.cs b/src/NServiceBus.Core/IStartableEndpointWithExternallyManagedContainer.cs index 4fa7f7b9f3..131ef89689 100644 --- a/src/NServiceBus.Core/IStartableEndpointWithExternallyManagedContainer.cs +++ b/src/NServiceBus.Core/IStartableEndpointWithExternallyManagedContainer.cs @@ -11,11 +11,11 @@ namespace NServiceBus; /// Represents an endpoint in the start-up phase where the container is externally managed. /// [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] -[Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public interface IStartableEndpointWithExternallyManagedContainer { /// @@ -25,11 +25,11 @@ public interface IStartableEndpointWithExternallyManagedContainer /// A to observe. /// A reference to the endpoint. [ObsoleteMetadata( - Message = "Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", + Message = "Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint", TreatAsErrorFromVersion = "11", RemoveInVersion = "12", ReplacementTypeOrMember = "IServiceCollection.AddNServiceBusEndpoint")] - [Obsolete("Self-hosting an endpoint is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Self-hosting endpoints is no longer recommended. Instead, consider using a Microsoft IHostApplicationBuilder-based host to manage the lifecycle of your endpoint. Use 'IServiceCollection.AddNServiceBusEndpoint' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] Task Start(IServiceProvider builder, CancellationToken cancellationToken = default); /// diff --git a/src/NServiceBus.Core/Logging/DefaultFactory.cs b/src/NServiceBus.Core/Logging/DefaultFactory.cs index f7b4f56e45..1adcda0618 100644 --- a/src/NServiceBus.Core/Logging/DefaultFactory.cs +++ b/src/NServiceBus.Core/Logging/DefaultFactory.cs @@ -11,10 +11,10 @@ namespace NServiceBus.Logging; /// The default . /// [ObsoleteMetadata( - Message = "Use services.Configure() to configure the built-in rolling file logging provider", + ReplacementTypeOrMember = "IServiceCollection.Configure()", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] -[Obsolete("Use services.Configure() to configure the built-in rolling file logging provider. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Use 'IServiceCollection.Configure()' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public class DefaultFactory : LoggingFactoryDefinition { /// @@ -30,7 +30,7 @@ public DefaultFactory() } catch (Exception e) { - throw new Exception("Unable to determine the logging output directory. Check the inner exception for further information, or configure a custom logging directory using 'services.Configure(o => o.Directory = \"...\")'.", e); + throw new Exception("Unable to determine the logging output directory. Check the inner exception for further information, or configure a custom logging directory using 'IServiceCollection.Configure(o => o.Directory = \"...\")'.", e); } }); level = new Lazy(() => LogLevel.Info); @@ -49,20 +49,20 @@ public DefaultFactory() /// Controls the . /// [ObsoleteMetadata( - Message = "Set RollingLoggerProviderOptions.LogLevel instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical", + Message = "Use 'RollingLoggerProviderOptions.LogLevel' instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] - [Obsolete("Set RollingLoggerProviderOptions.LogLevel instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Use 'RollingLoggerProviderOptions.LogLevel' instead. Note: NServiceBus.Logging.LogLevel.Info maps to Microsoft.Extensions.Logging.LogLevel.Information, Warn to Warning, Fatal to Critical. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public void Level(LogLevel level) => this.level = new Lazy(() => level); /// /// The directory to log files to. /// [ObsoleteMetadata( - Message = "Set RollingLoggerProviderOptions.Directory instead", + ReplacementTypeOrMember = "RollingLoggerProviderOptions.Directory", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] - [Obsolete("Set RollingLoggerProviderOptions.Directory instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Use 'RollingLoggerProviderOptions.Directory' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public void Directory(string directory) { ArgumentException.ThrowIfNullOrWhiteSpace(directory); diff --git a/src/NServiceBus.Core/Logging/LogManager.cs b/src/NServiceBus.Core/Logging/LogManager.cs index d86236bcf7..663da2cc5c 100644 --- a/src/NServiceBus.Core/Logging/LogManager.cs +++ b/src/NServiceBus.Core/Logging/LogManager.cs @@ -23,10 +23,10 @@ public static class LogManager /// Used to inject an instance of into . /// [ObsoleteMetadata( - Message = "Use services.Configure() to configure the built-in rolling file logging provider", + Message = "Configure logging through Microsoft.Extensions.Logging instead", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] - [Obsolete("Use services.Configure() to configure the built-in rolling file logging provider. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Configure logging through Microsoft.Extensions.Logging instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] #pragma warning disable CS0618 // DefaultFactory and LoggingFactoryDefinition are deprecated; LogManager must reference them internally during the deprecation window public static T Use() where T : LoggingFactoryDefinition, new() { @@ -47,10 +47,10 @@ public static class LogManager /// Replace this instance at application startup to redirect log events to the custom logging library. /// [ObsoleteMetadata( - Message = "Configure logging through Microsoft.Extensions.Logging directly", + Message = "Configure logging through Microsoft.Extensions.Logging instead", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] - [Obsolete("Configure logging through Microsoft.Extensions.Logging directly. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + [Obsolete("Configure logging through Microsoft.Extensions.Logging instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public static void UseFactory(ILoggerFactory loggerFactory) { ArgumentNullException.ThrowIfNull(loggerFactory); diff --git a/src/NServiceBus.Core/Logging/LoggingDefinition.cs b/src/NServiceBus.Core/Logging/LoggingDefinition.cs index 728c98fc4a..88fc7501b5 100644 --- a/src/NServiceBus.Core/Logging/LoggingDefinition.cs +++ b/src/NServiceBus.Core/Logging/LoggingDefinition.cs @@ -9,10 +9,10 @@ namespace NServiceBus.Logging; /// Base class for logging definitions. /// [ObsoleteMetadata( - Message = "Implement Microsoft.Extensions.Logging.ILoggerProvider directly and register via services.AddSingleton()", + Message = "Implement a custom logger using Microsoft.Extensions.Logging.ILoggerProvider instead", TreatAsErrorFromVersion = "11", RemoveInVersion = "12")] -[Obsolete("Implement Microsoft.Extensions.Logging.ILoggerProvider directly and register via services.AddSingleton(). Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] +[Obsolete("Implement a custom logger using Microsoft.Extensions.Logging.ILoggerProvider instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] public abstract class LoggingFactoryDefinition { /// diff --git a/src/NServiceBus.Core/Sagas/SagaComponent.cs b/src/NServiceBus.Core/Sagas/SagaComponent.cs index cfe17212eb..48655bfe30 100644 --- a/src/NServiceBus.Core/Sagas/SagaComponent.cs +++ b/src/NServiceBus.Core/Sagas/SagaComponent.cs @@ -57,7 +57,7 @@ public Settings(SettingsHolder settings) [RequiresUnreferencedCode("Saga discovery using assembly scanning might require access to unreferenced code")] public void AddDiscoveredSagas(IEnumerable availableTypes) { - var discoveredSagas = NServiceBus.Sagas.SagaMetadata.CreateMany(availableTypes); + var discoveredSagas = Sagas.SagaMetadata.CreateMany(availableTypes); SagaMetadata.AddRange(discoveredSagas); } diff --git a/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs b/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs index 28f57ea38f..f36b6637e3 100644 --- a/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs +++ b/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs @@ -56,11 +56,10 @@ from typeHandled in messagesBeingHandled /// /// Registers the given potential handler type. /// - [ObsoleteMetadata(Message = "Deprecated in favor of a strongly-typed alternative", + [ObsoleteMetadata(ReplacementTypeOrMember = "AddHandler()", TreatAsErrorFromVersion = "11", - RemoveInVersion = "12", - ReplacementTypeOrMember = "AddHandler()")] - [Obsolete("Deprecated in favor of a strongly-typed alternative. Use 'AddHandler()' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] + RemoveInVersion = "12")] + [Obsolete("Use 'AddHandler()' instead. Will be treated as an error from version 11.0.0. Will be removed in version 12.0.0.", false)] [RequiresUnreferencedCode(TrimmingMessage)] public void RegisterHandler(Type handlerType) => AddHandlerWithReflection(handlerType);