我試圖將我們的應用程序之一從Castle Windsor 2.1升級到2.5。Castle Windsor的DictionaryAdapter
我已經刪除了所有的城堡DLL的,並添加2.5版本從城堡的網站上下載:
Castle.Core.dll Castle.Windsor.dll
做遷移之前,我也有對我的項目的引用:
Castle.Components.DictionaryAdapter.dll
然而,根據剋日什托夫·Koźmic的帖子here,這樣的引用不再neces sary,因爲DictionaryAdapter現在捆綁到Castle.Core.dll中。
在移除它,我得到的錯誤所有的地方說:
錯誤6的類型或命名空間名稱DictionaryComponent「不能 (是否缺少using指令或程序集 參考?)
和
錯誤64類型或命名空間名稱 'DictionaryKey' 找不到 (是否缺少using指令或程序集引用?)
和
錯誤27類型或命名空間名稱「DictionaryKeyAttribute」不能 找到(是否缺少using指令或程序集引用?)
我當時想我會添加一個參考Castle.Components.DictionaryAdapter.dll,因爲它可能是CORE沒有上面列出它實現的類型。
做的是擺脫了所有的錯誤,但給了我一個新問題:
錯誤8「Castle.Components.DictionaryAdapter.DictionaryAdapterFactory」兩個存在的類型「D:.NET \程序\庫\ Castle.Core.dll」和 'd:.NET \程序\庫\ Castle.Components.DictionaryAdapter.dll'
以下方法實現發生的錯誤:
internal static ISettingService GetServiceFromAdapterFactory(NameValueCollection collection)
{
var adapter = new DictionaryAdapterFactory();
return adapter.GetAdapter<ISettingService>(collection);
}
有沒有人遇到這樣的問題從2.1升級到2.5時可以提供一些建議嗎?
在此先感謝。