Hi all,

In Windsor version 2.5.2 this code works:

  [Interceptor(typeof(IInterceptorForFoo))]
  public class Foo
  {
public string Value { get; set; }
  }

  public interface IInterceptorForFoo : IInterceptor
  {
  }

  public class InterceptorForFoo : IInterceptorForFoo
  {
public void Intercept(IInvocation invocation)
{
}
  }


  var container = new WindsorContainer();

  container.Register(
    Component.For<Foo>(),
    Component.For<IInterceptorForFoo>().ImplementedBy<InterceptorForFoo>()
  );

  container.Resolve<Foo>();

In 3.0 however, I get the following exception when trying to resolve IFoo:

Castle.MicroKernel.ComponentActivator.ComponentActivatorException :
ComponentActivator: could not proxy Foo
----> Castle.MicroKernel.Resolvers.DependencyResolverException : The
interceptor 'IInterceptorForFoo' could not be resolved. Component
'InterceptorForFoo' matching the type specified was found in the container.
Did you mean to use it? If so, please specify the reference via name, or
register the interceptor without specifying its name.

How do I register an interceptor without specifying its name?

Regards,
Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-users@googlegroups.com.
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to