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百科
精彩评论