JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
563 stars 118 forks source link

scanner.AssembliesFromApplicationBaseDirectory scans also subfolders? #301

Closed DMDTT closed 2 years ago

DMDTT commented 2 years ago

Hello there,

we have a test environment with an nightly build deployment. The binaries are located in "numbered"-folders and are located under the execution path of the deployed app.

We use "AssembliesFromApplicationBaseDirectory"-scan profile.

We want lamar to avoid scanning subfolders. Is there a switch as the scanning takes very long if for what ever reason many "not needed assemblies " exist in subfolders

app: .NetCore 3.1 + Lamar 5.0.2

jeremydmiller commented 2 years ago

Yeah, man, I wouldn't recommend that then. Can you isolate the assemblies that should be scanned to a child folder? It's generally bad performance wise to let the scanning go on the base directory itself. That, or do something so that you allow list the assemblies that actually get scanned. I use an assembly level attribute when I do that.

jeremydmiller commented 2 years ago

Nothing actionable here, possible pull request if you want a "shallow" folder scan.