tags:

views:

99

answers:

1

I'm working on an application where we are using StructureMap 2.5.4 to scan a directory like below.

ObjectFactory.Configure(scanner => scanner.Scan(x =>
{
    x.AssembliesFromPath(settings.Directory);
    x.AddAllTypesOf(typeof(IScannerConvention)).NameBy(n => n.Name);
}));

For some reason the types implementing IScannerConvention are not registered. If we change AddAllTypesOf to typeof(object) we can see that the types we are looking for are registered with the container but that is obviously not what we want to do. We have also tried moving the assemblies containing types implementing IScannerConvention to the application base directory and use x.AssembliesFromApplicationBaseDirectory(). This works and the expected types are registered. But again, this is not a solution that we can use as it will cause conflicts moving all assemblies to the application base directory. At this point I really have no ide on what could be wrong.

Any ideas are most welcome!

A: 

Got some help on this matter on the StructureMap google group. You can find the solution here: http://groups.google.com/group/structuremap-users/browse_thread/thread/73ae145b3766bfb1

Kristoffer Ahl