Export to GitHub

linfu - issue #12

ContainerExtensions.LoadFrom(IServiceContainer, Assembly) is a no-op


Posted on Feb 2, 2009 by Happy Giraffe

As currently implemented ContainerExtensions.LoadFrom(IServiceContainer, Assembly) is a no-op. The problem is that it creates an AssemblyTargetLoader<T> with an empty TypeLoaders collection. Since all the work appears to be done by the objects in the TypeLoaders collection no types get loaded.

The obvious fix would be to copy the loaders used by the Loader class:

containerLoader.TypeLoaders.Add(new FactoryAttributeLoader()); containerLoader.TypeLoaders.Add(new ImplementsAttributeLoader()); containerLoader.TypeLoaders.Add(new PreprocessorLoader()); containerLoader.TypeLoaders.Add(new PostProcessorLoader()); containerLoader.TypeLoaders.Add(new InterceptorAttributeLoader(this));

The problem is the last one, InterceptorAttributeLoader. It requires a ILoader<T> as an argument and nothing in the assembly LoadFrom implements ILoader<T>.

Comment #1

Posted on Feb 9, 2009 by Massive Bird

Verified and patched in the trunk, revision 356.

Status: Fixed

Labels:
Type-Defect Priority-Medium