Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

StructurizrAnnotationsComponentFinderStrategy doesn't support target assembly as constructor argument #3

@DenisZhukovski

Description

@DenisZhukovski

As for me it would be nice to add an ability to configure StructurizrAnnotationsComponentFinderStrategy with an assembly to be able to scan it for attributes. It seem right now current active assembly is supported only.
It seems I found this piece of code in the examples:

string assemblyPath = typeof(StructurizrAnnotations).Assembly.Location;
            DefaultAssemblyResolver resolver = new DefaultAssemblyResolver();
            resolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath));
            AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(
                assemblyPath,
                new ReaderParameters { AssemblyResolver = resolver }
            );

            ComponentFinder componentFinder = new ComponentFinder(
                webApplication,
                "Structurizr.Examples.Annotations",
                new StructurizrAnnotationsComponentFinderStrategy(assembly)
            );

AS for me it would be nice to make it part of the StructurizrAnnotationsComponentFinderStrategy constructor. It will allow us to use it like this:
new StructurizrAnnotationsComponentFinderStrategy(typeof(MyType).Assembly)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions