Questions tagged [castle-dynamicproxy]

Castle DynamicProxy is a library for generating lightweight .NET proxies on the fly at runtime. Proxy objects allow calls to members of an object to be intercepted without modifying the code of the class.

Castle DynamicProxy is a library for generating lightweight .NET proxies on the fly at runtime. Proxy objects allow calls to members of an object to be intercepted without modifying the code of the class.

Resources

335 questions
1
vote
2 answers

Generic IPropertyChangedNotifier using Dynamic Proxy and wcf serialization problem

I have implemented a generic IPropertyChangedNotifier using castle dynamic proxy. Here I intercept setter call in Proxy objects so that i don't have to raise PropertyChanged event in setters of my domain objects. The purpose was to use these proxy…
1
vote
1 answer

Dynamic retry proxy

Consider the below, which works: public interface IService { void DoSomething(object arg); void DoSomethingElse(object arg, bool anotherArg); bool AndDoYetMoreStuff(object arg, object[] moreArgs); } public class Service : IService { …
Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
0
votes
1 answer

Proxying NHibernate Objects with Castle DynamicProxy swallows NH-Functionality

I'm doing things considered horrible by some lately, but I personally enjoy this kind of experiment. Here's a telegraph style description: Use NH to fetch data objects Each DataObject is wrapped by a CastleDynamicProxy When Properties decorated…
Sebastian Edelmeier
  • 4,095
  • 3
  • 39
  • 60
0
votes
1 answer

Dynamic Proxy : wrapping constructors

I'm taking a stab at creating a Active Record implementation (I know about Castle's initiative, and it's very good) for another type of data provider (ESRIs geodatabases, using ESRIs .NET libraries) and I'm reaching something interesting. I have a…
George Silva
  • 3,454
  • 10
  • 39
  • 64
0
votes
0 answers

.NET6 Castle.DynamicProxy dependency injection does not work

I have a .NET3.0 program I am moving to .NET6. We use Castle.DynamicProxy to intercept calls to certain methods and then log the parameter those methods was called with. In .NET3 to add this to the class MyController we use IWindsorContainer…
0
votes
1 answer

How to dynamically instantiate a proxy class?

I have used Castle.DynamicProxy to create an interceptor that implements IInterceptor. This interceptor does some work related with logging. I have successfully injected this into multiple classes using the default Microsoft Dependency Injection and…
0
votes
1 answer

Intercepting method from abstract parent on derived instance using DynamicProxy

I have an object derived from an abstract base class and I want to intercept a method on the object. Does DynamicProxy support this scenario? I seem to only be able to create proxies by interface or without target but not by abstract base class with…
Jesper Larsen-Ledet
  • 6,625
  • 3
  • 30
  • 42
0
votes
0 answers

Intercept methods calls of existing DLL at Runtime

How to intercept methods calls during runtime, For example, I have a DLL of my application that contains some methods that I would like to bypass or intercept to add some logs. Can I use some techniques of AOP like Dynamic Proxy / Methods…
Mselmi Ali
  • 1,139
  • 2
  • 18
  • 28
0
votes
2 answers

How can I tell if IRegistrationBuilder.EnableInterfaceInterceptors() has already been called?

I'm using Autofac.Extras.DynamicProxy to write a couple of IInterceptors. They can be used individually, or both together. I want consumers of these interceptors to be able to attach them to Autofac registrations easily, so I wrote an…
0
votes
1 answer

Autofac did not intercept which type of IInterceptor

I had an issue which is I am trying to Log Interceptor using Autofac.But logaspect did not intercept. Indeed aspectInterceptor selector did not intercept when click to add method. So you can see my flow , After saw Jonathan's comment , I want to ask…
0
votes
2 answers

Interceptor doesn't work when call a method inside another method in same class

I have used Autofac DynamicProxy to implement cache for methods. But inceptor doesn't work when call a method inside another method in same class. for example I have Class ClassRepository as: public class ClassRepository : IClassRepository { …
Amirhossein Yari
  • 2,054
  • 3
  • 26
  • 38
0
votes
3 answers

Windsor MixIn is a Singleton?

I have a MixIn that requires some state to operate. I am registering it as so.. container.Register(Component.For(Of ICat) _ .ImplementedBy(Of Cat) _ .LifeStyle.Transient _ …
brumschlag
0
votes
2 answers

Castle Dynamic Proxy wants to intercept Object.GetType()

In a project, I'm using a Castle Dynamic Proxy to wrap all code run by a façade in try/catch blocks (sounds odd? Explained here). That works fine, but to make sure all method calls are intercepted, I throw an exception when I come across something…
joneberg
  • 235
  • 1
  • 10
0
votes
0 answers

unit test did not respond as expected

I am using Validationaspect in my project, I have fluentvalidation rules, these are simple rules, like not accepting a field blank. validation works in debugger mode,throws fluentvalidation.validationexception Everything worked correctly in debugger…
0
votes
1 answer

How to access custom method attributes from ProxyGenerationHook in Castle.DynamicProxy

I'm implementing Interceptor mechanism in .NET with Castle.DynamicProxy (Castle.Core 4.4.0). I'm following this tutorial for selecting which method to intercept:…
Tolga Cakir
  • 725
  • 1
  • 7
  • 13