我使用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以某种方式照顾它?
瞬态和 PerWcfSession 生活方式有什么区别 (顺便说一下, PerWcfSession 和 PerWcfOperation 之间有什么不同?在WCF服务上调用的每个操作都有自己的会话吗?)
答案 0 :(得分:1)
由于在这种情况下,wcf服务由设施解决,您不需要发布任何内容。该设施将照顾。