tags:

views:

20

answers:

0

I'm writing an OnMethodBoundary aspect with PostSharp 1.5, and I need to store some information at instance level. So, I'm using InstanceTag that works almost fine for this.

But it fail in the following scenario; if I use multicast inheritance in mode Multicast... and the aspect is applied on a new method of the derived class... The field to hold the InstanceTag is on both clases.

Is there a way to make the InstanceTag field protected or another mechanism to store information per instance (not per instance per class).

On top of my head I can think in a static dictionary of instances. But, it will require a lot of logic for lock in multithread scenarions and for remove instances when they are disposed(?).

Thank you very much in advance.