I'm in the process of migrating to StructureMap 4 (specifically version 4.0.1.318).
I have what looks to me like appropriate object registration:
For<ISomeInterface>().Use(() => GetConcreteInstance());
For<ISomeInterface>().MissingNamedInstanceIs.TheDefault();
For<ISomeOtherThing>().Add<OtherConcreteClass>()
.Ctor<ISomeInterface>().IsNamedInstance("Special");
However, if no "Special" instance of ISomeInterface is configured (which would typically occur in another Registry, if it needs to happen), then rather than falling back to the default instance (which is what I would expect) a call like this
[Container].GetAllInstances<ISomeOtherThing>();
results in the following: System.NotSupportedException: Instance's of type 'StructureMap.Pipeline.DefaultInstance' does not support ToNamedClose() and cannot be used as a MissingInstance
I'm guessing something is wrong in my registration... but what?