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

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

Open
DenisZhukovski opened this issue Nov 30, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@DenisZhukovski
Copy link

DenisZhukovski commented Nov 30, 2020

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)

@simonbrowndotje simonbrowndotje added enhancement New feature or request help wanted Extra attention is needed labels Nov 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants