tags:

views:

105

answers:

0

I use StructureMapConfiguration class and add the registry classes to register the components. It's all working file but when I try to do the same across projects within a solution, structureMap starts throwing exception of not being able to find the resistration of the component.

Let's say I have two projects. For each project, I add a file that inherits from Registry and overrides the configure method like one below.

public class ScreenRegistry : Registry
{
    protected override void configure()
    {
        StructureMapConfiguration.BuildInstancesOf<IManagementSummaryPresenter>().TheDefaultIsConcreteType
            <ManagementSummaryPresenter>().AsSingletons();
        StructureMapConfiguration.BuildInstancesOf<IManagementSummaryView>().TheDefaultIsConcreteType
            <ManagementSummaryView>().AsSingletons();
    }
}

Then I add that registry file with structureMap

StructureMapConfiguration.AddRegistry(new ScreenRegistry());

At this point everything is fine and structure map gives me the instance back. But when I add another project to the solution that has it's own registry, structureMap starts throwing exception that it can't find the implementation.

Any idea how to solve this issue. Thanks