Hi Chris (a thousand pardons for my previous mistake),
I got it to work with the new beta 1 release. I can put this in my App.Config:
<sectionExtension type="MyCompany.Unity.AppSettingsSectionExtension, UnityTest" />
<register type="MyCompany.Unity.INumber, UnityTest" mapTo="MyCompany.Unity.MyObject, UnityTest">
<property name="Number" type="System.Int32">
<appSetting key="myNumber" />
<add key="myNumber" value="31" />
<add key="mySecondNumber" value="7" />
And the "Number" property on the resolved MyObject instance gets initialized to 31, as expected. However, I also have an attribute class defined like this:
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property, AllowMultiple = false)]
public class AppSettingsDependencyAttribute : DependencyResolutionAttribute
public AppSettingsDependencyAttribute(string key)
this.key = key;
public override IDependencyResolverPolicy CreateResolver(Type typeToResolve)
return new AppSettingsDependencyResolver(typeToResolve, key);
private string key;
When I set it on the "Number2" property in MyObject, it doesn't get set. In fact, the attribute constructor never gets called. Is there something I need to do to turn DependencyResolutionAttribute's on? (The returned "AppSettingsDependencyResolver"
is the same one wired into the configuration elements).
Quite happy with the beta 1, incidentally.