Problem Setting Properties in Unity Application Block

Topics: Enterprise Library Core, General discussion
Sep 11, 2008 at 7:23 PM
Edited Sep 11, 2008 at 7:24 PM
I'm trying to set a property dependency value using Unity application block.  It works for strings, but for no other type.  Even when I specify a type converter it still fails.  I attached a copy of my config for the container.  Everytime this runs it says that the value for Enable cannot be resolved.  I have adorned the property with the Dependency attribute.  It doesn't even call a type converter if I specify one.  $0$0$0$0Here is the exception I get on the call to Resolve:Resolution of the dependency failed, type = "IMyTypeHandler", name = "". Exception message is: The current build operation (build key Build Key[Register_Types.Register, null]) failed: The value for the property "Enable" could not be resolved. (Strategy type Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy, index 2)$0Here is a sample of my configuration for the container:$0$0<container name="Registration">$0        <types>$0          <!-- Lifetime managers specified using the type aliases -->          <type type="IHandler" mapTo="Register">            <lifetime type="singleton" />            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement,                                    Microsoft.Practices.Unity.Configuration">             <property name="EnableString" propertyType="System.String">               <value value="true"/>             </property>              <property name="Enable" propertyType="System.Boolean" >               <value value="true" typeConverter="System.BooleanConverter"/>              </property>            </typeConfig>          </type>        </types>     </container>Can you not set non string property types?$0$0Thanks,$0$0K$0$0
Sep 11, 2008 at 7:25 PM

Please post this question to Unity's discussion list