How to apply PolicyInjection in ASP.NET page?

Topics: Policy Injection Application Block
May 25, 2010 at 4:26 AM

I create a custom call handler and attribute, then I call PolicyInjection.Wrap(this.GetType(), this) in a page's constructor, then it will throw following exception:

Resolution of the dependency failed, type = "ASP.admin_test_aspx", name = "(none)".
Exception occurred while: while resolving.
Exception is: SynchronizationLockException - The read lock is being released without being held.

How can I do?

May 25, 2010 at 5:54 AM

The Unity Hands-on-Lab includes this scenario.  It can be downloaded here -  You may want to use Unity as most of the PIAB stuff have already been moved there.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.

May 25, 2010 at 9:41 AM
Edited May 25, 2010 at 9:55 AM

Thanks for your replay,

I have see your posted URL, and I found it's for Enterprise Library 4.1. Currently, I want to use Enterprise Library 5.1 and Unity 2.0. I donwload the Hand-on-lab, I can't find any sample about how to intergrated Unity 2.0 and call handler in  I try to write a demo based on Unity 1.2's Hand-on-lab, but my custom handler cannot be applied under Untiy 2.0.



May 26, 2010 at 1:25 AM

Unity 2.0 Hands-On-Labs has just been released.  Here's the link to the download page -

For Unity questions, please post it in the Unity forum -


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.