Hi Mike, I've already registered this issue in donjon and wrote a patch a couple of days ago. I'm waiting for a commiter to review it.
http://support.castleproject.org/projects/IOC/issues/view/IOC-ISSUE-141 I'm using a custom build of Microkernel with this patch applied and it works fine. Regards, Germán Schuager http://blog.schuager.com On Fri, Jan 16, 2009 at 5:04 PM, Mike Nichols <[email protected]>wrote: > > This test fails. It fails due to the ClosedTypeDataService closing > IDataService and here is the error. As you can see, kernel is not > seeing the service name to resolve. Is this due to the CLR bug with > Generic type GenericTypeDefinition ? If so, how do you get around this > without resorting to injecting the IKernel? I see in the handler that > the ctor dependency FullName is 'null' but trying to register with the > GenericTypeDefinition doesn't work either....Should I post a donjon? > > ERROR: > RegistrationServiceTest+SomeAppServiceImpl is waiting for the > following dependencies: > > Services: > - RegistrationServiceTest+ISomeDomainService`1 > [[RegistrationServiceTest+DomainObj, Test, Version=0.6.0.0, > Culture=neutral, PublicKeyToken=null]] which was registered but is > also waiting for dependencies. > > RegistrationServiceTest+SomDomainServiceImpl`1 is waiting for the > following dependencies: > > Services: > - which was not registered. > > > [Test] > public void should_resolved_generic_types() > { > kernel = new DefaultKernel(); > kernel.Register( > > AllTypes.FromAssembly(GetType().Assembly).BasedOn<IMarker>(), > > Component.For(typeof(IDataService<DomainObj>)).ImplementedBy(typeof > (ClosedTypeDataService)), > > Component.For(typeof(ISomeDomainService<>)).ImplementedBy(typeof > (SomeDomainServiceImpl<>))); > > var handler = kernel.GetAssignableHandlers(typeof > (ISomeAppService<Msg>))[0]; > var service = > handler.Resolve(CreationContext.Empty); > Assert.IsInstanceOfType(typeof(SomeAppServiceImpl), > service); > } > > > public class Msg { } > public class DomainObj { } > > public interface ISomeDomainService<T> { } > public interface IDataService<T> { } > public interface IMarker { } > public interface ISomeAppService<T> : IMarker { } > > public class SomeAppServiceImpl : ISomeAppService<Msg> > { > public > SomeAppServiceImpl(ISomeDomainService<DomainObj> cmd) > { > } > } > > public class SomeDomainServiceImpl<T> : > ISomeDomainService<T> > { > public SomeDomainServiceImpl(IDataService<T> inner) > { > } > } > public class ClosedTypeDataService : IDataService<DomainObj> > { } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
