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
Another thing to look for is to make sure that the dependency (class) that you are injecting is public. If the class is internal, it can cause this issue.
This problem was fixed by replacing ObjectFactory.Initialize
with ObjectFactory.Configure
and adding the assemblies in my project:
ObjectFactory.Configure(x =>
{
x.Scan(scan =>
{
scan.LookForRegistries();
scan.Assembly("MyAssembly");
scan.Assembly("MyAssembly");
});
});