Skip to content

Get IAssemblyNameRetriever from Kernel instead of instanciating it #17

@BrunoJuchli

Description

@BrunoJuchli

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".

Metadata

Metadata

Assignees

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