我有一个.net application
,它使用Spring.net。 也有一个interface
的2个实现。应该使用哪一个 - 它基于configuration file
。Spring.net ContextRegistry.GetContext失败,2接口实现
的bootstrap
为Spring有
<objects>
<object id="Impl1" name="Impl1" type="namespace.Impl1, IInterface" >
</object>
<object id="Impl2" name="Impl2" type="namespace.Impl2, IInterface" >
</object>
</objects>
它未能上
var appContext = ContextRegistry.GetContext();
的错误信息是:
类型 'System.Configuration.ConfigurationErrorsException' 的未处理的异常发生在 Spring.Core.dll
其他信息:预期 单个匹配的对象,但发现2:: 系统类型[namespace.IInterface]被定义的无 独特对象:不合格依赖通过 构造器参数类型为[namespace.IInterface]的索引2表示.Collections.Specialized.OrderedDictionary