Wednesday 15 June 2011

c# - Unity Interception - unwanted recursion -



c# - Unity Interception - unwanted recursion -

i've tried implementing unity's interception i'm having weird problem invoking getnext delegate causes unwanted recursion.

in attached screenshot can see stack trace during debugging. in case i'm breaking on call:

var methodreturn = getnext()(input, getnext);

notice phone call has happened 5 times. what's interesting problem number of times repeats dependent on in architecture phone call originates. here first phone call interception occurred setupsession, pretty high in phone call stack , repeats 8 times. when lower, downwards towards info layer, happens 1 time (which correct).

i'm next guides here:

http://msdn.microsoft.com/en-us/library/dn178466(v=pandp.30).aspx

using .addnewextension() , i've got decorator around standard unitycontainer which, when calling registertype() adding 2 injections every registration:

new interceptor<interfaceinterceptor>(), new interceptionbehavior<nloggerinterceptor>()

i'm pretty lost here ideas welcome!

thanks

c# unity-container

No comments:

Post a Comment