zcz527 / autofac

Automatically exported from code.google.com/p/autofac
Other
0 stars 0 forks source link

AutofacContrib.DynamicProxy2: Internal interfaces are not intercepted (and no exception) #355

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

            var builder = new ContainerBuilder();
                builder
                .RegisterType<SomeConcreteType>()
                .EnableInterfaceInterceptors()
                .InterceptedBy(typeof(SomeInterceptor))
                .As<ISomeInternalInterface>();

            builder.Build().Resolve<ISomeInternalInterface>().SomeMethod(); // <-- will not be intercepted

DynamicProxy2 is not able to proxy internal interfaces. I guess that's why the 
interception doesn't work. But an exception would be nice, because the 
interception just silently disables itself :)

Autofac/Contrib v 2.5.2.830
.NET 4.0

Original issue reported on code.google.com by lars.and...@gmail.com on 9 Feb 2012 at 7:30

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 20 Sep 2012 at 4:28

GoogleCodeExporter commented 8 years ago

Original comment by travis.illig on 21 Sep 2012 at 4:34

GoogleCodeExporter commented 8 years ago
Looks like it was checking to ensure the interception was for interfaces but 
not that it was also visible. I've updated this so you'll get an exception when 
you resolve an incorrectly registered component and the exception explains what 
to check for. Since the actual proxy isn't generated until resolve time, I 
can't really provide a container build-time exception.

Original comment by travis.illig on 14 Dec 2012 at 12:00

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 53a4efafa8d7.

Original comment by travis.illig on 14 Dec 2012 at 12:09