1
我正在使用Castle Windsor和我的WCF服務(使用控制檯應用程序託管)。Castle Windsor發佈WCF服務中的瞬態組件
這是我的配置:
container.AddFacility<WcfFacility>().
Register(Component.For<IService>().
ImplementedBy<MyService>().LifeStyle.Transient.
AsWcfService(new DefaultServiceModel().
AddBaseAddresses("someURI").
AddEndpoints(WcfEndpoint.BoundTo(new BasicHttpBinding())).
PublishMetadata(o => o.EnableHttpGet())));
我選擇了短暫的生活方式對我的服務和一些這個服務的依賴性也瞬變。據我瞭解,在閱讀文檔和一些博客,如果你有生活方式瞬態組件,你應該負責釋放它。
我應該在哪裏發佈我的瞬態分量?這是我的責任,或者WcfFacility照顧這件事?
是什麼瞬態和PerWcfSession生活方式 之間的差異(順便說一句什麼是心不是每個呼籲WCF服務運行有其自己的會話PerWcfSession和PerWcfOperation不同之間?)