I've run into this problem too. I get around it like so:

public class MyInterceptor : IInterceptor
{
     public MyInterceptor(MyTarget mytarget) {}
     public void Intercept(IInvocation invocation)
     {
           invocation.ReturnValue = invocation.Method.Invoke(mytarget,
invocation.Arguments);
     }
}

of course in my case MyTarget doesn't come from the container, I
construct it by hand. You might be able to get around this by defining
a custom componentactivator for your component.

On Feb 12, 4:26 am, Thom Lawrence <[email protected]> wrote:
> I'm trying to access the original object instance, unproxied, in an
> interceptor. After running into some stack overflows, I stepped
> through in the debugger and noticed that InvocationTarget is the same
> object as Proxy. This can't be right, can it?
>
> Is there a way I could be setting my interceptor up incorrectly to
> cause this? I'm just doing:
>
> model.Interceptors.AddLast(new InterceptorReference(typeof
> (MyInterceptor)));
>
> In a ComponentRegistered handler.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to