Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load assemblies from base path for web applications #16

Open
ArnaudB88 opened this issue May 2, 2019 · 1 comment
Open

Load assemblies from base path for web applications #16

ArnaudB88 opened this issue May 2, 2019 · 1 comment

Comments

@ArnaudB88
Copy link

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 ;)

@ENikS
Copy link
Contributor

ENikS commented May 2, 2019

Would you like to send a pull request with the implementatin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants