Skip to content

ICallHandler did not intercept class with HandlerAttribute after upgrading from Unity 4 to Unity 5 #27

@raytangRT

Description

@raytangRT

Hi,

I am trying to update the Unity from 4.0 to 5.10, and my logging interceptor did not work, can somebody give me some idea? Thanks.

My Container setup/

container.Register<ICallHandler, LogCallHandler>(nameof(LogCallHandler));
container.AddNewExtension<Interception>();

and all my interface-implementaion registrations are going through the following helper function.

 if (typeof(Service).IsInterface)
{
        injectionMembers.Add(new InterceptionBehavior<PolicyInjectionBehavior>());
        injectionMembers.Add(new Interceptor<InterfaceInterceptor>());
 }
        var lifetimeManager = registerAsSingleton ? new ContainerControlledLifetimeManager() : null;

         container.RegisterType<Service, Implementation>(name, lifetimeManager, injectionMembers.ToArray());

and my targetted class are annotated with a HandlerAttribute

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions