Skip to content

Load assemblies from base path for web applications #16

@ArnaudB88

Description

@ArnaudB88

Hi,

The AllClasses.FromAssembliesInBasePath() does not work for web applications.
Since all our applications (web/service/console apps) in the solution use the same container bootstrap logic, it would be nice to let the registration by convention work for all types of applications.

Second: it would be nice to increase the performance of it by providing an overload of this method which can filter the assembly names.

My suggestion is to use code from StructureMap (end-of-life DI container), more specific:
The code in AllClasses.FromAssembliesInBasePath() can use the same code from:
AssemblyFinder.FindAssemblies(func,func,bool)

https://github.com/structuremap/structuremap/blob/master/src/StructureMap/Graph/AssemblyFinder.cs

Result:

  • It always loads the assemblies needed, also for web applications.
  • It is much faster since you can filter the assembly names (eg. fullName.startsWith( "Foo")) before loading each type from the assemblies.

I think this is a quick win for this repo ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions