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

Get IAssemblyNameRetriever from Kernel instead of instanciating it #17

Open
BrunoJuchli opened this issue Apr 14, 2014 · 0 comments
Open
Assignees

Comments

@BrunoJuchli
Copy link

To speed up our Integration tests we currently replace the implementation of IAssemblyNameRetriever with one of our own which does not create a separate app domain.

To do so we currently need to roll our own implementation of the ExtensionsForIKernel.Bind method. This is due to the method doing new AssemblyNameRetriever();, so there is no way for us to override the implementation of IAssemblyNameRetriever.

We would like the extension to change to either
-get the IAssemblyNameRetriever from the Kernel
-let the Kernel build the entire IAssemblyFinder

Sadly there is currently no way to access the kernel's components or resolution features since there's only an IBindingRoot.

I've got some (rather ugly...) suggestions:

  • Extend IBindingRoot with functionality to acces resolution / components. Bad in regards to ISP.

or

  • The Convention extension could provide a module which resolves an instance of IAssemblyFinder or IAssemblyNameRetriever which is then stored in a static field - to be accessed by the extension method. Disadvantage: This does not work with multiple kernel instances. The last initialized kernel "wins".
@scott-xu scott-xu self-assigned this Oct 10, 2017
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