Hey,I need your Help !

May 17, 2010 at 3:52 AM
Edited May 17, 2010 at 4:59 AM

 First,I am chinese,so my english is suck,I guess!I hope I can let you know what's my problem:)

   I used the Unity 2.0 IOC container to inject the object to the interface.

  I think post some codes is better than say.

 content:

    <type type="IPeople" mapTo="ChinesePeople" name="ChineseFactory">
          <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
            <constructor>
              <param name="n_weapon" parameterType="IWeapon">
                <dependency name="sword"/>
              </param>
            </constructor>
          </typeConfig>
    </type>

    <typeConfig> tag is can not be indentifide by the ASP.NET .But when I used the old Unity IOC container which contain "Microsoft.Practices.Unity" ,Microsoft.Practices.Unity.Configuration" ,and Microsoft.Practices.ObjectBuilder2" ,it can be indentified! why Unity 2.0 without "Microsoft.Practices.ObjectBuilder2" ? and when I put the "Microsoft.Practices.ObjectBuilder2" to the Unity 2.0 is still not working!

    I don't want to use the old version !please help!

 

 

May 17, 2010 at 4:40 AM

The <typeConfig> element was removed and the <type> element is now <register> in Unity 2.0  Put the constructor element directly under the <register> element.  This is how it should look like:

<unity>
   <container>
       <register type=.. mapTo=.... >
             <constructor>
                  <param...
             </constructor>
       </register>
    </container>
</unity>

As you will notice, the <containers>, <types> , <typeConfig> were now removed.  this is included in the documentation, please check it out.

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

May 17, 2010 at 5:02 AM

Thank you for anything!AvanadeSupport. :)

Actually!that's what I think about it,but I don't know where to check the new one ,can you tell me where or how?Thank you again!

May 17, 2010 at 5:09 AM

The Unity 2.0 documentation can be found here - http://unity.codeplex.com/releases/view/31277.  You can choose either the chm file or the installer file. 

 

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

May 17, 2010 at 5:13 AM

Yeah!I just find it.

AvanadeSupport ,you are my hero!nice to meet you ,and I hope I can be your friends there!I will bother you again and again at the future!lol