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

Merged
merged 10 commits into from
Jul 1, 2024

Conversation

danielmarbach
Copy link
Contributor

@danielmarbach danielmarbach commented Jun 21, 2024

Fixes #7092

@danielmarbach
Copy link
Contributor Author

Including @kentdr and @bording in the review since you have been involved in introducing that interface package

@@ -53,6 +53,8 @@ internal AssemblyScanner(Assembly assemblyToScan)

internal string CoreAssemblyName { get; set; } = NServiceBusCoreAssemblyName;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept this around because someone might use this via reflection. To keep things consistent, I added another internal property for now.

@danielmarbach
Copy link
Contributor Author

See an extended idea to this PR #7085

…warding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
danielmarbach and others added 2 commits July 1, 2024 17:57
Co-authored-by: Brandon Ording <bording@gmail.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
@danielmarbach danielmarbach enabled auto-merge (squash) July 1, 2024 18:44
@danielmarbach danielmarbach merged commit 3a7c74c into master Jul 1, 2024
3 checks passed
@danielmarbach danielmarbach deleted the assembly-scanner-interfaces branch July 1, 2024 18:47
danielmarbach added a commit that referenced this pull request Jul 1, 2024
…e Interfaces (#7081)

* Add a test to verify the messages referencing core are scanned

* Failing test for messages that reference message interfaces

* Unify in one test due avoid assembly loading issues

* Cleanup

* AssemblyScanner should scan assemblies that reference the message interfaces assembly to make sure messages using those interfaces can be discovered and do not act like unobtrusive messages

* Extract into method with a huge comment and inline hints

* Add a type forwarding test as a safety net

* Update src/NServiceBus.Core.Tests/AssemblyScanner/When_using_type_forwarding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Brandon Ording <bording@gmail.com>

* string.Equals

Co-authored-by: Brandon Ording <bording@gmail.com>

---------

Co-authored-by: danielmarbach <danielmarbach@users.noreply.github.com>
Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
(cherry picked from commit 3a7c74c)
danielmarbach added a commit that referenced this pull request Jul 1, 2024
…e Interfaces (#7081)

* Add a test to verify the messages referencing core are scanned

* Failing test for messages that reference message interfaces

* Unify in one test due avoid assembly loading issues

* Cleanup

* AssemblyScanner should scan assemblies that reference the message interfaces assembly to make sure messages using those interfaces can be discovered and do not act like unobtrusive messages

* Extract into method with a huge comment and inline hints

* Add a type forwarding test as a safety net

* Update src/NServiceBus.Core.Tests/AssemblyScanner/When_using_type_forwarding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Brandon Ording <bording@gmail.com>

* string.Equals

Co-authored-by: Brandon Ording <bording@gmail.com>

---------

Co-authored-by: danielmarbach <danielmarbach@users.noreply.github.com>
Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
(cherry picked from commit 3a7c74c)
danielmarbach added a commit that referenced this pull request Jul 1, 2024
…e Interfaces (#7081)

* Add a test to verify the messages referencing core are scanned

* Failing test for messages that reference message interfaces

* Unify in one test due avoid assembly loading issues

* Cleanup

* AssemblyScanner should scan assemblies that reference the message interfaces assembly to make sure messages using those interfaces can be discovered and do not act like unobtrusive messages

* Extract into method with a huge comment and inline hints

* Add a type forwarding test as a safety net

* Update src/NServiceBus.Core.Tests/AssemblyScanner/When_using_type_forwarding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Brandon Ording <bording@gmail.com>

* string.Equals

Co-authored-by: Brandon Ording <bording@gmail.com>

---------

Co-authored-by: danielmarbach <danielmarbach@users.noreply.github.com>
Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
(cherry picked from commit 3a7c74c)
danielmarbach added a commit that referenced this pull request Jul 2, 2024
…e Interfaces (#7081) (#7089)

* Add a test to verify the messages referencing core are scanned

* Failing test for messages that reference message interfaces

* Unify in one test due avoid assembly loading issues

* Cleanup

* AssemblyScanner should scan assemblies that reference the message interfaces assembly to make sure messages using those interfaces can be discovered and do not act like unobtrusive messages

* Extract into method with a huge comment and inline hints

* Add a type forwarding test as a safety net

* Update src/NServiceBus.Core.Tests/AssemblyScanner/When_using_type_forwarding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Brandon Ording <bording@gmail.com>

* string.Equals

Co-authored-by: Brandon Ording <bording@gmail.com>

---------

Co-authored-by: danielmarbach <danielmarbach@users.noreply.github.com>
Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
(cherry picked from commit 3a7c74c)
danielmarbach added a commit that referenced this pull request Jul 2, 2024
…e Interfaces (#7091)

* AssemblyScanner doesn't scan message assemblies that reference Message Interfaces (#7081)

* Add a test to verify the messages referencing core are scanned

* Failing test for messages that reference message interfaces

* Unify in one test due avoid assembly loading issues

* Cleanup

* AssemblyScanner should scan assemblies that reference the message interfaces assembly to make sure messages using those interfaces can be discovered and do not act like unobtrusive messages

* Extract into method with a huge comment and inline hints

* Add a type forwarding test as a safety net

* Update src/NServiceBus.Core.Tests/AssemblyScanner/When_using_type_forwarding.cs

Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Brandon Ording <bording@gmail.com>

* string.Equals

Co-authored-by: Brandon Ording <bording@gmail.com>

---------

Co-authored-by: danielmarbach <danielmarbach@users.noreply.github.com>
Co-authored-by: Phil Bastian <155411597+PhilBastian@users.noreply.github.com>
Co-authored-by: Brandon Ording <bording@gmail.com>
(cherry picked from commit 3a7c74c)

* Set MessageInterfacesAssemblyName to null in tests

* Compatible v8 settings for tests

---------

Co-authored-by: Brandon Ording <bording@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssemblyScanner doesn't scan message assemblies that reference Message Interfaces
4 participants