After switching from StructureMap 2.6.4 to StructureMap 3.1.6, registration for our common interfaces, which we have in our nested containers, stopped working, and I can not find the reason why they no longer work.
This is the error I get
StructureMap.StructureMapConfigurationException: The default instance is not registered and cannot be automatically determined for type "ITest <ExtendClass>"
Here is an example demonstrating the problem:
public class StructureMapContainerTests { [Test] public void GlobalContainer() { var container = new Container(); container.Configure(x => x.For(typeof(ITest<>)).Use(typeof(Test<>))); var impl = container.GetInstance<ITest<ExtendClass>>(); Debug.WriteLine(impl.Temp());
Both of the above tests work in StructureMap 2.6.4, but in 3.1.6 the second test, which uses a nested container, no longer works.
Does anyone know if this function has been removed or am I just using it incorrectly and in this case can help me? :)
source share