为什么 Unity 在解析注册为某个接口的实现的类时应用注入行为

Pav*_*nin 5 .net c# dependency-injection unity-container interception

我像这样注册依赖项:

this.Container.RegisterType<IFoo, Foo>(
    new ContainerControlledLifetimeManager(),
    new InterceptionBehavior<PolicyInjectionBehavior>(), new Interceptor<InterfaceInterceptor>());
Run Code Online (Sandbox Code Playgroud)

这很好用。但是,当我解决Foo而不是IFoo出现错误时:

ArgumentException - 传递的类型必须是接口。

看来 Unity 仍在尝试应用InterfaceInterceptor此依赖项。但为什么?