The value of the property 'type' cannot be parsed

Oct 9, 2008 at 3:56 PM

Getting this error setting container configuration below.

The error is: Could not load type MyServices.Services.Interfaces.ICustomerRepository' from assembly 'MyServices.Services'.

 

<

unity>

 

<

typeAliases>

 

<

typeAlias alias="ICustomerRepository" type="MyServices.Services.Interfaces.ICustomerRepository, MyServices.Services" />

 

<

typeAlias alias="CustomerRepository" type="MyServices.Services.CustomerRepository, MyServices.Services" />

 

</

typeAliases>

 

<

containers>

 

<

container name="containerOne">

 

<

types>

 

 

<type type="ICustomerRepository" mapTo="CustomerRepository" />

 

</

types>

 

</

container>

 

</

containers>

 

</

unity>


// called in DI basepage class

 

 

IUnityContainer container = new UnityContainer();

 

 

UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");

 

section.Containers[

"containerOne"].Configure(container);

 

container.Resolve<

ICustomerRepository>();

 

Oct 10, 2008 at 5:24 PM
This is usually caused by either: 1) a typo in the config file, or 2) the assembly isn't available on the probing path to load the type from.

The best way to debug this is fire up fuslogvw.exe and see where the load is failing.

Oct 10, 2008 at 7:21 PM
Edited Oct 10, 2008 at 7:47 PM
Ok, it was some namespaces that had changed.

Now I need to figure out how to map classes without having them referenced from within the UI. I assume that the assembly must be in the web bin before it can be mapped in the config?