I have a SysMsgManager class defined in CoreService project as following:
public class SysMsgManager
{
private ISysMsgRepository _SysMsgRepository;
public SysMsgManager()
{
_SysMsgRepository = ObjectFactory.GetInstance<ISysMsgRepository>();
}
....
}
In my DataAccess project I have 'ISysMsgRepository' interface and two concrete implementations defined as following:
namespace DataAccess.Repository
{
[Pluggable("Default")]
public class SysMsgRepository : ISysMsgRepository
{
...
}
}
namespace DataAccess.Repository
{
[Pluggable("Stub")]
public class SysMsgRepository_Test : ISysMsgRepository
{
...
}
}
and this is what I have in my StructureMap.config file
<StructureMap>
<Assembly Name="CoreService" />
<Assembly Name="DataAccess" />
<PluginFamily
Assembly="DataAccess"
Type="DataAccess.Repository.ISysMsgRepository"
DefaultKey="Default" />
</StructureMap>
When I try to run my app, I got the following error:
StructureMap Exception Code: 202\nNo Default Instance defined for PluginFamily DataAccess.Repository.ISysMsgRepository, DataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Can anyone help me to solve this problem? Thanks!