Problems when adding a <key,value> to InvocationContext

Topics: Policy Injection Application Block
Dec 11, 2007 at 9:14 PM
I´m using a Custom Handler that in the Invoke Method, executes a PreProcess Method before the getNext() sentence and a PostProcess Method after this sentence executes.
In the PreProcess Method I put a <key,value> pair in the InvocationContext Dictionary (something like input.InvocationContext.add(k,v)) and in the PostProcess Method I retrieve the <key,value> pair and do something with it.
Everything was working fine with all the classes I needed to work with, but I started to have problem with a particular class that has some methods I need to intercept with this handler. What happens is that the PreProcess Method fails when adding the <key,value> pair, because the key already exists. It´s like if the handler executes twice instead only once. The strange thing is that the chain of handlers only has one handler (the Custom Handler mentioned) and it only happens with a particular class.
If someone could give me a chance, I really appreciate it.
Thanks a lot.