Strange problem while using PolicyInjection

Topics: Policy Injection Application Block
May 8, 2010 at 5:12 AM

While I using PolicyInjection in Enterprise Library 4.1, it will have a strange problem:

I create a custom callhandler, a test class and test method. Then, I apply the callhandler in the test method of test class. When I debug Invoke, I found the method will be called three times. First time, it will call GetType method, second time, it will call my applied method, last time, it also will call GetType method. I don't know why Invoke mehtod will be called three times instead of one time?

I also found if I add a constructor method in my test class, the Invoke method will be called only one time.  If I remove the constructor method, it will call three times.

 

 

May 11, 2010 at 1:10 AM

"First time, it will call GetType method, second time, it will call my applied method, last time, it also will call GetType method." - I don't quite get this.  Where is the GetType method? 

If you could send us a sample solution which repro this, we could probably figure out faster what is happening.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com