castle-dynamicproxy

Cannot Serialize a List<> of DynamicProxy2-generated objects with DataContractJsonSerializer

I'm running into an issue using System.Runtime.Serialization.Json.DataContractJsonSerializer to serialize a List<T> of proxied objects. It works fine with a single proxied object, but the List makes it blow up. Something like this: using System.Collections.Generic; using System.Runtime.Serialization; using Castle.DynamicProxy; using ...

C# Dynamic Proxy 2 generate proxy from class with code in constructor ? How to ?

Hello, I have problem with Dynamic Proxy. I have a class which has logic in constructor. Like this: public class Document { public ExtraList<Foo> Possitions {get; set;} public Document() { Possitions = new ExtraList<Foo>(); } } where 'ExtraList' is a special list which can have setted a property of object 'Foo' which have to ...

Add attributes to class & properties on the fly

Is there anything in castle that can let me add attributes to a class on the fly? I have a dto in a project that I want to use as a data contract in a wcf service. I'd need to add a [DataContract] attribute to the class and then [DataMember] to each of the properties. I could just replicate the class in the service layer and th...

Castle DynamicProxy Interface Proxy Generation

I have a WindsorContainer. I have a ILazyComponentLoader (if it matters) and an Interface (ISomething) with an Interceptor attribute on in. [Interceptor(typeof(DynamicImplementationInterceptor)] public interface ISomething I want Windsor to use ProxyGenerator.CreateInterfaceProxyWithoutTarget when resolving the interface via contai...

Generating Interface Proxies

Hello, 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 IView instance. I ran into a situation where I need to create a custom class on...

Cannot CreateClassProxyWithTarget on DbConnection

Hi there, We're trying to create a proxy on a DbConnection inheritor's instance and we got the following exception. We can't figure what's wrong with our case. Is there any way to create a proxy on an existing DbConnection's instance? Thank you very much. > Castle.DynamicProxy.Tests.ClassProxyWithTargetTestCase: 0 code Test 'Castle...

castle dynamic proxy interceptor for wpf ierrordatainfo

hi! can someone tell me how to do a interceptor implements (behavior) for windsor castle dynamic proxy, the interface the ierrordatainfo? many thanks. ...

Castle Windsor DynamicProxy Interception IInvocation Documentation

On a Castle Castle.DynamicProxy.IInvocation, what's the difference between GetConcreteMethod GetConcreteMethodInvocationTarget Method I read the documentation, but I don't understand the difference, especially between the first two. I'm guessing that Method is just the MethodInfo for the method on the actual registered type? ...

Doing interception with structuremap

I'm trying to do some attribute-based interception using structuremap but I'm struggling to tie up the last loose ends. I have a custom Registry that scans my assemblies and in this Registry I have defined the following ITypeInterceptor whose purpose it is to match types decorated with the given attribute and then apply the interceptor ...

Registering components with castle that are dynamically created by DynamicProxy

So I've been working hard for a while to build a solution which creates certain components using nothing but Castle DynamicProxy (version 2.2) and an interceptor. Everything looks great except that at the end of all this I realized I need to register these components with the windsor container. Is this possible or has my work been for na...

Castle Windsor Proxy for Interface without Target

I have a WindsorContainer with a IModelInterceptorsSelector. It works well except for component's that have no implementation (eg. have all behavior handled dynamically by an IInterceptor). If I try to resolve a component with an interface only, I get: Castle.MicroKernel.ComponentActivator.ComponentActivatorException occurred Message...