structuremap/structuremap — Issue #27: Not registering types when having multiple scans calling SingleImplementaionsOfInterface()
Author: vyrak
Created: 2011-11-03 20:25:55+00:00
State: open

class Program
{
static void Main(string[] args)
{
var container = ObjectFactory.Container;
container.Configure(c =>
{
c.Scan(x =>
{
x.TheCallingAssembly();
x.IncludeNamespaceContainingType();
x.SingleImplementationsOfInterface();
});
c.Scan(x =>
{
x.TheCallingAssembly();
x.IncludeNamespaceContainingType();
x.SingleImplementationsOfInterface();
});
});

//This will resolve without an issue
Console.WriteLine(container.GetInstance());

//This will throw a StructureMapException (code: 202)
Console.WriteLine(container.GetInstance());
}
}