Unity - loading configuration, resolving types in different namespace
Situation: 2 projects 1 project is of type WCF Service Library (ProjA) 1
project is a console application with Unity references (ProjB)
Inside ProjB I want to do UnityContainer.LoadConfiguration and resolve
types which are in ProjA.
I have tried this in ProjB.AppConfig file
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<alias alias="IClass" type="OtherNameSpace.IClass, OtherNameSpace"/>
<alias alias="Class" type="OtherNameSpace.Class, OtherNameSpace"/>
<container>
<register type="IClass" mapTo="Class"/>
</container>
</unity>
For reference the ProjB namespace is ClientHost and ProjB namespace is
OtherNameSpace.
The exception I get is: The type name or alias OtherNameSoace.IClass,
OtherNameSpace could not be resolved. Please check your configuration file
and verify this type name.
No comments:
Post a Comment