Skip to content

Commit f7ebe85

Browse files
committed
Corrected A.E.DynamicProxy - no longer supports TransparentProxy interception.
1 parent 2e107b0 commit f7ebe85

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

docs/advanced/interceptors.rst

+3-14
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,7 @@ Under the covers, ``EnableInterfaceInterceptors()`` creates an interface proxy t
8585
Both techniques can be used in conjunction with the assembly scanning support, so you can configure batches of components using the same methods.
8686

8787
**Special case: WCF proxy and remoting objects**
88-
While WCF proxy objects *look* like interfaces, the ``EnableInterfaceInterceptors()`` mechanism won't work because, behind the scenes, .NET is actually using a ``System.Runtime.Remoting.TransparentProxy`` object that behaves like the interface. If you want interception on a WCF proxy, you need to use the ``InterceptTransparentProxy()`` method.
89-
90-
.. sourcecode:: csharp
91-
92-
var cb = new ContainerBuilder();
93-
cb.RegisterType<TestServiceInterceptor>();
94-
cb.Register(c => CreateChannelFactory()).SingleInstance();
95-
cb
96-
.Register(c => c.Resolve<ChannelFactory<ITestService>>().CreateChannel())
97-
.InterceptTransparentProxy(typeof(IClientChannel))
98-
.InterceptedBy(typeof(TestServiceInterceptor))
99-
.UseWcfSafeRelease();
88+
While WCF proxy objects *look* like interfaces, the ``EnableInterfaceInterceptors()`` mechanism won't work because, behind the scenes, the .NET desktop framework is actually using a ``System.Runtime.Remoting.TransparentProxy`` object that behaves like the interface. As of v6.0.0 of ``Autofac.Extras.DynamicProxy`` the ability to intercept ``TransparentProxy`` objects was removed in an effort to improve cross-platform support.
10089

10190
.. _associate_interceptors:
10291

@@ -186,7 +175,7 @@ To enable proxying via interfaces, the component must provide its services throu
186175
WCF Proxies
187176
-----------
188177

189-
As mentioned earlier, WCF proxies and other remoting types are special cases and can't use standard interface or class interception. You must use ``InterceptTransparentProxy()`` on those types.
178+
As mentioned earlier, WCF proxies and other remoting types are special cases and can't use standard interface or class interception.
190179

191180
Class Interceptors and UsingConstructor
192181
---------------------------------------
@@ -223,4 +212,4 @@ One, you can remove your direct Castle.Core reference. The transitive references
223212

224213
Two, if you can't remove your direct reference or removing it doesn't work... all of the direct dependencies you have will need to update to version 4.2.0 or higher of Castle.Core. You'll have to file issues with those projects; it's not something Autofac can fix for you.
225214

226-
`For reference, here's the Castle.Core issue discussing this challenge. <https://github.com/castleproject/Core/issues/288>`_
215+
`For reference, here's the Castle.Core issue discussing this challenge. <https://github.com/castleproject/Core/issues/288>`_

0 commit comments

Comments
 (0)