StructureMap Exception Code: 202 No Default Instance defined for PluginFamily

前端 未结 8 1202
-上瘾入骨i
-上瘾入骨i 2020-12-20 11:05

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

相关标签:
8条回答
  • 2020-12-20 11:49

    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.

    0 讨论(0)
  • 2020-12-20 11:53

    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");
        });
    });
    
    0 讨论(0)
提交回复
热议问题