Is it possible to configure a Castle Dynamic Proxy with Instance method of the WindsorContainer?

StackOverflow https://stackoverflow.com/questions/13811155

문제

... or does Castle need to have control over the construction process in order to wrap the object with the proxy?

I've tried a few different configurations - below is the one that I'm currently using, but the Interceptor is not being applied when I make a request for the object:

container.Kernel.Register(Component.For<IMyService>()
            .Instance(myService)
            .Interceptors(InterceptorReference.ForType<MyServiceProxy>()).Last,
        Component.For<MyServiceProxy>()
);
도움이 되었습니까?

해결책

No, the default InstanceActivator does not support proxying.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top