Cannot Load Type - Why is it referring to Unity assembly

Sep 23, 2008 at 7:43 PM
I am hoping someone can help with this.   I am getting the following error when I am testing trying to integrate Unity with some of our internal framework code.  

Could not load type 'SecuritySessionHelpers' from assembly 'Microsoft.Practices.Unity.Configuration, Version=1.1.0.912, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Why is it searching in the Unity.Configuration assembly?


<?

xml version="1.0" encoding="utf-8" ?>

 

<

configuration>

 

<

configSections>

 

<

section name="unity"

 

 

type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,

 

Microsoft.Practices.Unity.Configuration, Version=1.1.0.912,

Culture=neutral, PublicKeyToken=31bf3856ad364e35

" />

 

</

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

" />

 

<!--

User-defined type aliases -->

 

<

typeAlias alias="ISecuritySessionHelpers"

 

 

type="VanEckGlobal.Common.Security.ISecuritySessionHelpers, VanEckGlobal.Common.Security" />

 

<

typeAlias alias="SesuritySessionHelpers"

 

 

type="VanEckGlobal.Common.Security.SecuritySessionHelpers, VanEckGlobal.Common.Security" />

 

</

typeAliases>

 

<

containers>

 

<

container name="containerOne">

 

<

types>

 

<!--

Type mapping with no lifetime – defaults to "transient" -->

 

<

type type="ISecuritySessionHelpers" mapTo="SecuritySessionHelpers" />

 

 

</

types>

 

</

container>

 

<!--

... more containers here ... -->

 

</

containers>

 

</

unity>

 

</

configuration>



My load code is pretty simple:

 

 

// Use the configuration file to setup the container

 

 

 

 

UnityConfigurationSection section = (UnityConfigurationSection)

 

 

ConfigurationManager.GetSection(unityNode);

 

section.Containers[containerNode].Configure(container);


It blows up on the above line:  containerNode = "ContainerOne"  unityNode = "unity"


Any thoughts?

Sep 23, 2008 at 11:18 PM
You have a typo:

<typeAlias alias="SesuritySessionHelpers type="VanEckGlobal.Common.Security.SecuritySessionHelpers, VanEckGlobal.Common.Security" />