StructureMap Exception Code: 202 No Default Instance defined for PluginFamily

前端 未结 8 1211
-上瘾入骨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: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");
        });
    });
    

提交回复
热议问题