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
0
votes
1 answer

Proxy to interface + abstract class that intercepts only interface calls

I have the following structure: abstract class AbstractClass{...} interface Interface {...} class MyClass : AbstractClass, Interface{...} I want to create a proxy that would take MyClass as a target, could be cast to both - AbstractClass and…
M T
  • 968
  • 1
  • 8
  • 24
0
votes
1 answer

FileNotFoundException when creating a proxy object using Moq and Castle

I have a base abstract class that exists in a nuget package that I am implementing a concrete class for, something like this: public class MyConcreteClass : MyBaseAbstractClass { public MyConcreteClass(IAnInterfaceOne interfaceOne,…
httpNick
  • 2,524
  • 1
  • 22
  • 34
0
votes
1 answer

Castle Core Invocation create a cache key from intercepted method

I'm using a interface interceptor to cache all methods that starts with "Get" but i can't figure out how to generate a unique cache key for every unknown parameter it can be anything and using GetHashCode is not an option as i can't be 100% sure…
robgha01
  • 383
  • 4
  • 11
0
votes
1 answer

Decorate all instances returned by structuremap 4 with castle.Dynamicproxy

Right now I am decorating my StructureMap4 mapped types like, IFormsAuthenticationProvider with a Castle-generated proxy with tryCatchInterceptor in the StructureMap4 registry. For example: public class AuthenticationRegistry : Registry { …
Tiju John
  • 933
  • 11
  • 28
0
votes
1 answer

Generating Interface Proxies

Ran into an issue with a class; I have a class that looks like: public class MyPresenter { public MyPresenter(IMyView view) { } } public class SomePresenter { public SomePresenter(ISomeView view) { } } The custom views inherit from a base…
Brian Mains
  • 50,520
  • 35
  • 148
  • 257
0
votes
1 answer

Dynamic property interception

I have classes with properties implemented in dll (I can not change implementation because i do not have huge source code). I can not replace using of property Name with inherited class because project have thousands lines of code where it…
A191919
  • 3,422
  • 7
  • 49
  • 93
0
votes
1 answer

Is there a way to use Interception but stay independent of AOP framework behind

I will start by specifying that I am new to Interception. I want to replace some existing implementation of my project by bringing Interception into play, but I noticed that it actually brings me to be very tightly coupled to the AOP framework…
Learner
  • 3,297
  • 4
  • 37
  • 62
0
votes
1 answer

Is there a Windsor/DynamicProxy logging aspect, I can place as an attribute to my classes/methods?

In the castle stack? after the answer I came up with this: namespace Limpens.Windsor.LoggingAspect { using System; using Castle.Core; using Castle.Core.Interceptor; using Castle.Core.Logging; using Castle.MicroKernel; using…
Jan
  • 6,532
  • 9
  • 37
  • 48
0
votes
1 answer

Dynamically created Proxy a class

I'm building a class at runtime and creating objects of that. After that, I've several objects of this generated class. So, I'd like to proxy these objects: IInterceptor[] interceptors = new IInterceptor[1]; interceptors[0] = new…
Jordi
  • 20,868
  • 39
  • 149
  • 333
0
votes
1 answer

Castle DynamicProxy - Carry out deserialized invocation on different target

I am trying to use DynamicProxy to generate a proxy without a target, when a method on the proxy is invoked, I would like to serialize the IInvocation to then be passed to another process (on another machine) that will use an IOC container to…
jimmyjambles
  • 1,631
  • 2
  • 20
  • 34
0
votes
1 answer

Implementing ASP.NET MVC error handling using Castle Windsor's Dynamic Proxies

I spent a long time trying to get the ASP.NET MVC [HandleError] attribute to work in my websites. It seemed like a good idea to go with the solution offered by the framework, but I just couldn't get it to do anything useful. Then I tried writing my…
cedd
  • 1,741
  • 1
  • 21
  • 34
0
votes
1 answer

Generic argument in dynamic proxy interceptor

To add and retrieve objects from memory cache I have a cache util class with these methods: public static T GetNativeItem(string itemKey) public static void AddNativeItem(string key, object item, TimeSpan timeout) to remove some noise from data…
ale
  • 10,012
  • 5
  • 40
  • 49
0
votes
1 answer

Castle Interceptor Life Cycle and Memory Leak

I am new to castle dynamic proxy, and a bit curious.. When creating proxy of my object I save all the original values of its property on the interceptor (class scope) using dictionary and return the new value. Now I am wondering, when will this…
ktutnik
  • 6,882
  • 1
  • 29
  • 34
0
votes
0 answers

Castle DynamicProxy: access is denied when saving proxies assembly

Am using Castle DynamicProxy to create interceptors and persist the generated runtime proxies into assembly file. The next time I load the proxies assembly into ModuleScope and create few new proxies then try to save them back into the same file, I…
FirasR
  • 31
  • 2
0
votes
0 answers

Generate a builder with a Castle Windsor Typed Factory Facility

I'd like extend Windsor's Typed Factory Facility to create a factory which retains some state, e.g. properties on the factory itself that will be used to resolve dependencies on the things the factory creates. Kind of like a Typed Builder…
Mark
  • 1,784
  • 16
  • 26