c# - Autofac.Extras.DynamicProxy2 v3.0.6 got a exception -


i use autofac.extras.dynamicproxy2 implement aop policy.
updated autofac.extras.dynamicproxy2 v3.0.6, got exception:

the component activator = lookupservice (reflectionactivator), services = [wordbook.protocols.logic.ilookupservice], lifetime = autofac.core.lifetime.currentscopelifetime, sharing = none, ownership = ownedbylifetimescope cannot use interface interception provides services not publicly visible interfaces. check registration of component ensure you're not enabling interception , registering internal/private interface type.

this sourcecode:

containerbuilder builder = new containerbuilder();  builder.registertype<exceptioninterceptor>();  builder.registerassemblytypes(assembly.load("wordbooklogics")).asimplementedinterfaces().enableinterfaceinterceptors();  var container = builder.build();  dependencyresolver.setresolver(new autofacdependencyresolver(container)); 

it works @ autofac.extras.dynamicproxy2 v3.0.5.

do need adjust when updated?

i think found problem.

in autofac.extras.dynamicproxy2 v3.0.5, line 300 of registrationextensions.cs has isvisible condition.

but, isvisible condition replaced assembly.isinternaltodynamicproxy() in autofac.extras.dynamicproxy2 v3.0.6.

the isvisible property of public interface true, result call assembly.isinternaltodynamicproxy() on public interface false.

so, public interface visible, not mean internal dynamicproxy.

that's reason interception not work , got exception in autofac.extras.dynamicproxy2 v3.0.6.

i wait owner of autofac.extras.dynamicproxy2 fixing it.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -