I am new to StructureMap. I have downloaded and am using version 2.6.1.0. I keep getting the below error:
StructureMap Exception Code: 202 No Def
Mine was because I had accidentally referenced the concrete type in the constructor of another class rather than the interface
eg in structuremap i had
x.For().Use();
x.For().Use();
and constructor for Foo looked like this
public class Foo : IFoo {
public Foo(Bar bar) {...}
}
when it should have looked like this as SM couldn't just create an instance of Bar, it only knows how to make an IBar:
public class Foo : IFoo {
public Foo(IBar bar) {...}
}
It also meant that my exception referenced the concrete type instead of the interface but I missed that initially