Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions src/Custom.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
</PropertyGroup>

<ItemGroup>
<ProjectCapability Include="DynamicFileNestingEnabled" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you find all this magic ✨ ? Pretty cool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, we should use this in the functions as well

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, I was thinking we should probably go ahead and put it Directory.Build.props via RepoStandards to enable it everywhere.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BlowUpAfterDispatchBehavior : IBehavior<IBatchDispatchContext, IBatchDispa
{
public async Task Invoke(IBatchDispatchContext context, Func<IBatchDispatchContext, Task> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus.Core.Analyzer/Handlers/Handlers.Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,4 @@
</PropertyGroup>
</Target>

<ItemGroup>
<!-- Nest Foo.Parser.cs, Foo.Emitter.cs, Foo.Anything.cs under Foo.cs if the parent exists -->
<Compile Update="**\*.*.cs">
<DependentUpon>$([System.Text.RegularExpressions.Regex]::Replace('%(Filename)', '\..*$', '')).cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/NServiceBus.Core/Endpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ namespace NServiceBus;
/// Provides factory methods for creating and starting endpoint instances.
/// </summary>
[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
{
/// <summary>
Expand All @@ -27,11 +27,11 @@ public static class Endpoint
/// <param name="configuration">Configuration.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
[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<IStartableEndpoint> Create(EndpointConfiguration configuration, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(configuration);
Expand All @@ -55,11 +55,11 @@ public static async Task<IStartableEndpoint> Create(EndpointConfiguration config
/// <param name="configuration">Configuration.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
[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<IEndpointInstance> Start(EndpointConfiguration configuration, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(configuration);
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus.Core/EndpointConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public EndpointConfiguration(string endpointName)
/// Used to configure components in the container.
/// </summary>
[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<IServiceCollection> registration)
{
ArgumentNullException.ThrowIfNull(registration);
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Core/EndpointCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static EndpointCreator Create(EndpointConfiguration endpointConfiguration
settings.PreventReuse();

var endpointLogSlot = settings.Get<HostingComponent.Settings>().GetOrCreateEndpointLogSlot();
using var _ = Logging.LogManager.BeginSlotScope(endpointLogSlot);
using var _ = LogManager.BeginSlotScope(endpointLogSlot);

var assemblyScanningConfiguration = settings.Get<AssemblyScanningComponent.Configuration>();
var assemblyScanningComponent = AssemblyScanningComponent.Initialize(assemblyScanningConfiguration, settings);
Expand Down
8 changes: 4 additions & 4 deletions src/NServiceBus.Core/EndpointInstanceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace NServiceBus;
/// Extensions for <see cref="IEndpointInstance"/>.
/// </summary>
[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
{
/// <summary>
Expand All @@ -24,12 +24,12 @@ public static class EndpointInstanceExtensions
/// <param name="endpoint">The endpoint to stop.</param>
/// <param name="gracefulStopTimeout">The length of time granted to gracefully complete processing.</param>
[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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ namespace NServiceBus;
/// Provides factory methods for creating endpoints instances with an externally managed container.
/// </summary>
[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
{
/// <summary>
/// Creates a new startable endpoint based on the provided configuration that uses an externally managed container.
/// </summary>
[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);
Expand Down
8 changes: 4 additions & 4 deletions src/NServiceBus.Core/IEndpointInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ namespace NServiceBus;
/// Represents an endpoint in the running phase.
/// </summary>
[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
{
/// <summary>
/// Stops the endpoint.
/// </summary>
[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);
}
Loading