开发者

StructureMap Exception Code: 205 while trying to put an AppSettings value in constructor

I'm having trouble adding a value to my ImageService constructor.

My IUserRepository works, but when I try to put "absoluteImagePath" into the constructor (Bootstrapper) I get the following error:

StructureMap.StructureMapException:  
StructureMap Exception Code:  205  
Missing requested Instance property  
"absoluteImagePath" for InstanceKey  
"8a15766b-879b-4edb-b060-c868f35aef39

ImageService:

public ImageService(IUserRepository userRepository, string absoluteImagePath)
{
    _userRepository = userRepository;
    _absoluteImagePath = absoluteImagePath;
}

Bootstrapper:

For<IImageService>()
    .Use<ImageService>()
    .Ctor<string>("absoluteImagePath")
    .EqualToAppSetting("AbsoluteImagePath");开发者_JAVA百科
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜