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

AssemblyScanner doesn't scan message assemblies that reference Message Interfaces #7092

Closed
danielmarbach opened this issue Jul 2, 2024 · 0 comments · Fixed by #7081
Closed
Labels

Comments

@danielmarbach
Copy link
Contributor

danielmarbach commented Jul 2, 2024

Symptoms

The assembly scanner doesn't scan message assemblies that reference the recently introduced NServiceBus.MessageInterfaces assembly

Who's affected

Customers using the recently introduced NServiceBus.MessageInterfaces assembly

Root cause

The idea of message interfaces was to provide a stable package that message assemblies can reference without having to reference NServiceBus.Core. Unfortunately, the assembly scanner has not be changed to include the assemblies that reference the interface package which means effectively message assemblies that reference it will be treated as unobtrusive messages.

This has implications because it means the types have to be always loaded at runtime and any code that previously relied on messages that are marked as "NServiceBus messages" are no longer discovered during scanning and therefore not added to the message metadata registry (*), which makes it difficult to discover all message types even though effectively, you are using a well known and defined marker interface.

So switching from referencing Core to message interfaces effectively is a behavior change that also has other consequences that the customer is not aware of.

(*) The direct handled type is though because we inspect the generic type of the handler, but we already do this with unobtrusive messages too.

Backported to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant