tags:

views:

209

answers:

1

I want to use unity (2.0) to resolve my dependencies in a way so that i can configure policy injection (policies, matching rules and call handlers) in the .config file.

Or an other way to put it; i want my resolved objects to be "policy enabled", so that i can add and change to policies in config without have to recompile.

Any ideas on how to do that?

+2  A: 

OK - I also posted in the Unity-communitysite on CodePlex (http://unity.codeplex.com/Thread/View.aspx?ThreadId=215690) and got an answer there.

The trick is to add the EnterpriseLibraryCoreExtension to your container when you construct it. Like this:

_container.AddNewExtension<EnterpriseLibraryCoreExtension>();

This will pick up the configuration for your appdomains (app.config or web.config).

And that will give me the behavior I want!

marcusoft.net