Unrecognized element 'typeConfig'. (line 70)

Apr 12, 2010 at 4:00 AM

I've been running up against the following error message now for 48hr and have been unable to make any progress in figuring out what I did wrong.  I would really appreciate any help/feedback any of you may have.

 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="unity"
             type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection, Microsoft.Practices.Unity.Configuration"
                                                          />
  </configSections>

  <unity>
    <typeAliases>
      <!-- Lifetime manager types -->
      <typeAlias alias="singleton" type="Microsoft.Practices.Unity.ContainerControlledLifetimeManager, Microsoft.Practices.Unity" />
      <typeAlias alias="external" type="Microsoft.Practices.Unity.ExternallyControlledLifetimeManager, Microsoft.Practices.Unity" />

      <!--Common .Net Types-->
      <typeAlias alias="string" type="System.String, mscorlib" />
      <typeAlias alias="short" type="System.Int16, mscorlib" />
      <typeAlias alias="int" type="System.Int32, mscorlib" />
      <typeAlias alias="long" type="System.Int64, mscorlib" />
      <typeAlias alias="ushort" type="System.UInt16, mscorlib" />
      <typeAlias alias="uint" type="System.UInt32, mscorlib" />
      <typeAlias alias="ulong" type="System.UInt64, mscorlib" />

      <!-- Custom Interface types -->
      <typeAlias alias="IPlayerManagement" type="Ares.Common.Api.Server.IPlayerManagement, ClientServerAPI" />
      <typeAlias alias="IPositionTracker" type="Ares.Common.Api.Server.IPositionTracker, ClientServerAPI" />
      <typeAlias alias="IShotTracker" type="Ares.Common.Api.Server.IShotTracker, ClientServerAPI" />
      <typeAlias alias="ISignalStrengthTracker" type="Ares.Common.Api.Server.ISignalStrengthTracker, ClientServerAPI" />
      <typeAlias alias="IGameManager" type="Ares.Common.Api.Server.IGameManager, ClientServerAPI" />

      <typeAlias alias="IPlayerManagementProxy" type="Ares.Common.Api.Server.IPlayerManagementProxy, ClientServerAPI" />
      <typeAlias alias="IPositionTrackerProxy" type="Ares.Common.Api.Server.IPositionTrackerProxy, ClientServerAPI" />
      <typeAlias alias="IShotTrackerProxy" type="Ares.Common.Api.Server.IShotTrackerProxy, ClientServerAPI" />
      <typeAlias alias="ISignalStrengthTrackerProxy" type="Ares.Common.Api.Server.ISignalStrengthTrackerProxy, ClientServerAPI" />
      <typeAlias alias="IGameManagerProxy" type="Ares.Common.Api.Server.IGameManagerProxy, ClientServerAPI" />

      <!-- Custome Object Types -->
      <typeAlias alias="GameServerProxy" type="Ares.Server.GameServerProxy, AresServer" />

      <typeAlias alias="PlayerManagement" type="Ares.Server.PlayerManagement, AresServer" />
      <typeAlias alias="PositionTracker" type="Ares.Server.PositionTracker, AresServer" />
      <typeAlias alias="ShotTracker" type="Ares.Server.ShotTracker, AresServer" />
      <typeAlias alias="SignalStrengthTracker" type="Ares.Server.SignalStrengthTracker, AresServer" />

    </typeAliases>

    <containers>
      <container name="container">
        <types>
          
          <type type="IPlayerManagementProxy" mapTo="GameServerProxySingleton" >
            <lifetime type="singleton" />
          </type>
          <type type="IPositionTrackerProxy" mapTo="GameServerProxySingleton">
            <lifetime type="singleton" />
          </type>
          <type type="IShotTrackerProxy" mapTo="GameServerProxySingleton" >
            <lifetime type="singleton" />
          </type>
          <type type="ISignalStrengthTrackerProxy" mapTo="GameServerProxySingleton" >
            <lifetime type="singleton" />
          </type>
          <type type="IGameManagerProxy" mapTo="GameServerProxySingleton" >
            <lifetime type="singleton" />
          </type>


          <type type="GameServerProxySingleton" mapTo="GameServerProxy">
            <lifetime type="singleton" />
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
              </constructor>
            </typeConfig>
          </type>
          
          <type type="IPlayerManagement" mapTo="PlayerManagement" >
            <lifetime type="singleton" />
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="proxy" parameterType="IPlayerManagementProxy">
                  <dependency />
                </param>
              </constructor>
            </typeConfig>
          </type>

          <type type="IPositionTracker" mapTo="PositionTracker">
            <lifetime type="singleton" />
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="proxy" parameterType="IPositionTrackerProxy" >
                  <dependency />
                </param>
              </constructor>
            </typeConfig>
          </type>

          <type type="IShotTracker" mapTo="ShotTracker" >
            <lifetime type="singleton" />
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="proxy" parameterType="IShotTrackerProxy" >
                  <dependency />
                </param>
              </constructor>
            </typeConfig>
          </type>

          <type type="ISignalStrengthTracker" mapTo="SignalStrengthTracker" >
            <lifetime type="singleton" />
            <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement, Microsoft.Practices.Unity.Configuration">
              <constructor>
                <param name="proxy" parameterType="ISignalStrengthTrackerProxy" >
                  <dependency />
                </param>
              </constructor>
            </typeConfig>
          </type>




          <!--<type type="IGameManager" mapTo="GameManager" >
            <lifetime type="singleton" />
          </type>-->


        </types>
      </container>
    </containers>
  </unity>
</configuration>

 

Thanks in advanced.

Apr 12, 2010 at 4:49 AM

Are you trying to convert this to Unity 2.0? The <typeConfig> element is no longer used or recognized - just take it out, but leave the contents.

If it's Unity 1.2, then it would help to actually point out which line is line 70, it's kind of hard to debug from a forum post without more help from you.

Also, the extensionType attribute on <typeConfig> hasn't been required since Unity 1.2, so if nothing else you could remove them and reduce some of the noise in your config file.

 

 

Apr 12, 2010 at 5:06 AM

Thank you so much!

Yes, I was using Unity 2.0. Having not used it since 1.0ish I was unaware of this change.

 

I can not tell you how grateful I am, I've spent the last 2 days trying to figure this one out.