Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Unity Interception

$
0
0

I am using Unity Interception to handle logging.  I would like to use the IMethodInvocation target property, but it causing a stackoverflow exception.  It seems that by referencing this property, it is intercepted again.

How can I prevent this? 

I am able to reference other properties, such as MethodBase without this behavior. 

Any Ideas?

public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
{
        if (_log_Debug)
       {
           // this line is not intercepted
          var y = input.MethodBase;
   
           // the line below is intercepted again...
            var x = input.Target;
         }
    ...

Bill Behning


Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>