我需要我的單身服務取決於每個Web請求對象,並且我想使用Castle的TypedFactoryFacility爲我的對象自動創建工廠。城堡工廠短期生活依賴
我的註冊看起來像這樣:
我在web.xml中也註冊了每Web請求的續航時間,工廠接口看起來是這樣的:
public interface IMailMessageQueueProvider
{
IMailMessageQueue Get();
}
而且我得到這個不錯的錯誤:
Type Model.IMailMessageQueueProvider is abstract.
As such, it is not possible to instansiate it as implementation of service
Model.IMailMessageQueueProvider.
爲什麼城堡不創建工廠?
這是我跟一個參考:http://stw.castleproject.org/Windsor.Typed-Factory-Facility-interface-based-factories.ashx
哪個版本是? – 2012-03-30 22:10:19
只是爲了踢,嘗試重命名'Get'方法到別的東西('BuildCreateMailMessageQueue'或類似的東西) – 2012-03-30 22:11:54
我使用2.5,與其他名稱早些時候嘗試:創建()和GetIMailMessageQueue(),我可以嘗試其他人。 .. – 0lukasz0 2012-03-30 22:15:13