Unity XML config errors -- Generics??

Dec 1, 2009 at 9:01 PM

I am new to Unity and didn't have any trouble at the start but now I am getting an error and it is not very detailed at all.

I have my interface:

     public interface IActionRequestDao : IDao<ActionRequest, int>

IDao is a standard interface from another assembly that provides a base set of operations.  

and my class:

     public class ActionRequestDao : AbstractNHibernateDAO<ActionRequest, int>, IActionRequestDao

AbstactNHibernateDao (also different assembly) implements the interface IDao:

     public abstract class AbstractNHibernateDAO<T, IdT> : IDao<T, IdT>

If I try a "standard" mapping like below I get this error: Could not load type ActionRequestDao

<type type="ServReq.Data.Interfaces.IActionRequestDao, ServReq.Data.Interfaces"],  mapTo="ServReq.Data.ActionRequestDao, ServReq.Data" />

If I try what I've seen recommended for mapping Generics (below) I get this error: IActionRequestDao is not a GenericType. 

<type type="ServReq.Data.Interfaces.IActionRequestDao[[ServReq.Domain.ActionRequest, ServReq.Domain],[System.Int32, mscorlib]], ServReq.Data.Interfaces"],                                                                    mapTo="ServReq.Data.ActionRequestDao, ServReq.Data" />


Any help or hints would be appreciated..

Dec 2, 2009 at 12:38 AM
Edited Dec 2, 2009 at 12:39 AM

Do IActionRequestDao and ActionRequestDao belong on the same project?  Or ServReq.Data.Interface and SerReq.Data is really two different assemblies? Are they both referenced in  your project?

The type mapping  (without the "]," characters)

<type type="ServReq.Data.Interfaces.IActionRequestDao, ServReq.Data.Interfaces"  mapTo="ServReq.Data.ActionRequestDao, ServReq.Data" />

should work. 


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.