ninject / Ninject.Extensions.Conventions

Convention based binding for Ninject
Other
76 stars 28 forks source link

Get IAssemblyNameRetriever from Kernel instead of instanciating it #17

Open BrunoJuchli opened 10 years ago

BrunoJuchli commented 10 years ago

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:

or