StructureMap threw an exception after some refactoring
StructureMap Exception Code: 202 No Default Instance defined for PluginFamily IDoSomething
Solved by removing duplicates from assembly scan:
ObjectFactory.Initialize(c => { c.Scan(s => { s.TheCallingAssembly(); // Already loaded with TheCallingAssembly above // s.AssemblyContainingType<SomethingImplementation>(); s.ConnectImplementationsToTypesClosing(typeof(IDoSomething)); }); });
Turned out the IDoSomething was mapped to 2 implementations (of the same type) and StructureMap could not decide which was the default.