我有很多INotificationProcessor
s。因为BackorderCancelledEmailProcessor
我希望它打印一些东西,而不是通过正常渠道发送。所以我有一个PrintDispatcher
,但它出错,抱怨它无法解决printLocation
,即使我已经配置了它。
相关设置:
x.ForConcreteType<PrintDispatcher>()
.Configure
.Ctor<string>("printLocation")
.Is(Settings.Default.Printer);
x.ForConcreteType<BackorderCancelledEmailProcessor>()
.Configure
.Ctor<INotificationDispatcher>("notificationDispatcher")
.Is<PrintDispatcher>();
构造函数:
在BackorderCancelledEmailProcessor
构造函数中接受许多参数,其中之一是 notificationDispatcher。其他所有内容都已映射(并且无需切换即可工作)。另一个的构造函数是:
public PrintDispatcher(string printLocation)
错误:
Build Error on Instance '{GUID}' (Configured Instance of BackorderCancelledEmailProcessor)
for PluginType BackorderCancelledEmailProcessor
StructureMap.StructureMapException: StructureMap Exception Code: 205
Missing requested Instance property "printLocation" for InstanceKey "{Different GUID}"
-Stack Trace-