Error loading container configuration

Apr 10, 2008 at 12:35 PM
Edited Apr 10, 2008 at 12:35 PM
Hi there!

I couldn´t find anything on the internet and I am stuck with the following error :_)

Could not load type 'DemosUnity.LoggerLibrary.Logger' from assembly 'Microsoft.Practices.Unity.Configuration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I am pretty sure that I am missing something about the container type configuration

Additional Info
--------------------------------
CODE TO LOAD CONFIGURATION
-------------------------------------------
UnityConfigurationSection sec =
(UnityConfigurationSection)ConfigurationManager.GetSection("unity");
sec.Containers"porDefecto".Configure(iuc);


UNITY SECTION
-------------------------------------------
<unity>
<typeAliases>
<typeAlias alias="ILogger"
type="InterfacesCross.ILogger, Interfaces"/>

</typeAliases>
<containers>
<container name="porDefecto">
<types>
<type
type="ILogger" mapTo="LoggerLibrary.Logger" name="LoggerV1" />
<type
type="ILogger" mapTo="LoggerLibrary2.Logger2" name="LoggerV2" />
</types>
</container>
</containers>
</unity>


NAMESPACE INFO
----------------------------
solution name: DemosUnity
library projects/assembly names: LoggerLibrary , LoggerLibrary2
Apr 10, 2008 at 3:16 PM
Edited Apr 10, 2008 at 3:17 PM
You didn't specifty the mapTo type correctly in your <type> element.

<unity>
    <typeAliases>
      <typeAlias alias="ILogger"
                 type="InterfacesCross.ILogger, Interfaces"/>
 
    </typeAliases>
    <containers>
      <container name="porDefecto">
        <types>
          <type
            type="ILogger" mapTo="LoggerLibrary.Logger, LoggerLibrary" name="LoggerV1" />
          <type
            type="ILogger" mapTo="LoggerLibrary2.Logger2, LoggerLibrary2" name="LoggerV2" />
        </types>
      </container>
    </containers>
  </unity>

<unity>
    <typeAliases>
      <typeAlias alias="ILogger"
                 type="InterfacesCross.ILogger, Interfaces"/>
 
    </typeAliases>
    <containers>
      <container name="porDefecto">
        <types>
          <type
            type="ILogger" mapTo="LoggerLibrary.Logger" name="LoggerV1" />
          <type
            type="ILogger" mapTo="LoggerLibrary2.Logger2" name="LoggerV2" />
        </types>
      </container>
    </containers>
  </unity>

Apr 14, 2008 at 12:31 PM
thanks a lot!!

It works now :) It's great to have a couple of eyes more on the code :D

David