In the 2nd exmple you're not specifying the service so the Foo registers
itself as Foo, not as IFoo.

Make sure you consult the documentation:
http://stw.castleproject.org/Windsor.Registering-components-by-conventions.ashx
Krzysztof

2010/10/19 Matt Lund <[email protected]>

> So this works (meaning that the WhoAreYou() method gets called)
>
> var container = new WindsorContainer();
> container.Register(Component.For(typeof(IFoo)).ImplementedBy(typeof
> (Foo)));
> container.GetService<IFoo>().WhoAreYou();
>
> But with this code the GetService call returns null.  Any ideas?
>
> var container = new WindsorContainer();
> container.Register(AllTypes.FromThisAssembly());
> container.GetService<IFoo>().WhoAreYou();
>
> Note that the this is a simple single-assembly console app.  So the
> IFoo and Foo classes are sitting here in the same assembly as
> program.cs.
>
> --
> 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]<castle-project-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/castle-project-users?hl=en.
>
>

-- 
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.

Reply via email to