Registry Mirror
Skip to content

Missing Classes in Architecture  #292

Closed

Description

@SamuelMuellerKMS

We have considered, that classes from different assemblies with the same name and namespace only shown once.
We've the following assembly situation:

  • Assembly.UI (with root namespace "Assembly")
    • FeatureA/Class1
  • Assembly.Business (with root namespace "Assembly")
    • FeatureA/Class1

If you now setup an architecture for both assemblies and check that Classes must not end with '1' only one Class is found.
For reproduction i've added a little sample
ArchUnitSample.zip

Activity

  1. fgather commented on Sep 3, 2024

    @fgather
    Contributor

    Hi @SamuelMuellerKMS,

    that is a very interesting set-up. I'd expect that this might not only confuse ArchUnit, but also the developers? Since we identify classes by their namespace/name/generics constellation this is not a real surprise. Let's see if we can easily improve on that.

  2. added
    kind/bug
    kind/feature
    on Sep 3, 2024
  3. alexanderlinne commented on Sep 3, 2024

    @alexanderlinne
    Collaborator

    C# does provide … .GetType().AssemblyQualifiedName which would return e.g. Assembly.FeatureA.Class1, Assembly.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. The first step here would be to change the Loader to use the AssemblyQualifiedName instead of just the FullName. I will have another look into this later today.

    After that we could also expose the AssemblyQualifiedName in the interface. This would involve new methods for the fluent API and changes to the error messages. But this will definitely take some more time.

  4. fgather commented on Sep 4, 2024

    @fgather
    Contributor

    @SamuelMuellerKMS we just merged a fix for this into main. Would you be able to test it and give feedback?

  5. reopened this on Sep 4, 2024
  6. SamuelMuellerKMS commented on Sep 5, 2024

    @SamuelMuellerKMS
    Author

    I've tested your changes and everything works as expected now.
    thx for the fast fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugkind/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions