我有一個.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