【发布时间】:2017-10-13 07:44:15
【问题描述】:
我将 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())));
我为我的服务选择了瞬态生活方式,其中一些服务依赖项也是瞬态的。据我了解,在阅读文档和一些博客后,如果您有带有生活方式 Transient 的组件,您应该负责发布它。
我应该在哪里释放我的瞬态组件?这是我的责任,还是 WcfFacility 以某种方式负责?
Transient 和 PerWcfSession 生活方式有什么区别 (顺便说一句,PerWcfSession 和 PerWcfOperation 之间的区别是什么?不是每个在 WCF 服务上调用的操作都有自己的会话吗?)
【问题讨论】:
标签: castle-windsor