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

Castle DynamicProxy automatic property initialization

I have the following interfaces: interface IFoo {} interface IBar { IFoo Foo {get;set;} } Given a generated proxy implementation var generator = new ProxyGenerator(); var proxy = generator.CreateInterfaceProxyWithoutTarget(); Is there a…
Ruudjah
  • 807
  • 7
  • 27
0
votes
0 answers

Castle Interception. How to specify kind of Proxy using fluent API and InterceptorAttribute

Castle supports different kinds of Dynamic Proxy. How can I setup kind of proxy to use, when regestering a component with WindsorContainer using InterceptorAttribute?
Igor
  • 131
  • 1
  • 9
0
votes
0 answers

How to use the `Ninject.Extensions.Factory` to dynamically generate factories for internals classes?

I need to use the Ninject.Extensions.Factory to generate the constructor of internal classes. Follow one example: using Ninject.Extensions.Conventions; using Ninject.Modules; using Ninject.Extensions.Factory; namespace ClassLibrary { using…
user1785721
0
votes
1 answer

Tests run in Gallio / MbUnit fail; unable to load Castle DynamicProxy

I have a .NET 3.5 assembly covered by around 4000 MbUnit tests. I hve been running these using the mbunit.cons.exe program with no trouble. Now I am trying to switch to Gallio (mbunit.cons.exe started blowing up with an 'out of memory' exception…
andypaxo
  • 6,171
  • 3
  • 38
  • 53
0
votes
1 answer

How can I set up a generic paging object that lives on top of my generic collection object?

I have been working on removing a lot of code duplication from my application, specifically around my models. Several models also have a collection variant that is an IEnumerable of the model type. Previously all of the collection variants were…
user1618236
0
votes
1 answer

Reflect the returnType of an async method

Below is the code for an interceptor i wish to use for implementing a cacheprovider. I need to determine the return type of the method that will be invoked. This is pretty straight forward when the method invoked is synchronous. However most of the…
0
votes
0 answers

Castle Windsor: Mixing WCF clients with local components

I've got services (in the Castle Windsor sense) which are marked with the [ServiceContract] attribute. Some of them are WCF hosted, others run locally. I want my installer to be as generic as possibly. The logic I'm looking for is this: Look for…
0
votes
1 answer

How to add aspect to method in WinForms?

I inherited a large project written in WinForms where I have to carry a lot of small changes. I wanted to use AOP (Castle.DynamicProxy and Autofac), which so far has not caused me a problem. I wrote a simple Aspect: class TestAspect :…
wopi
  • 329
  • 4
  • 16
0
votes
1 answer

Why am I getting "Invalid Internal state" reflection exception with Castle DynamicProxy?

We added DynamicProxy to our ASP.NET web app a couple of weeks ago. The code ran fine in dev and QA, but when we pushed to production, we got the following exception (top of stack trace only): [ArgumentNullException: Invalid internal…
0
votes
1 answer

Castle DynamicProxy DefaultProxyBuilder.CreateClassProxyType does not work with proxy generators

I am trying to create a proxy type using mixins. In the following example, TypePresenter implements ICustomTypeDescriptor. When I create an instance the "GetProperties" throws a NotImplementedException. When I do the same thing with…
Phillip Scott Givens
  • 5,256
  • 4
  • 32
  • 54
0
votes
1 answer

Castle DynamicProxy v1 exception when proxy-ing methods with parameters?

I'm having problems proxying metods with parameters using Castle DynamicProxy v1.1.5.0. - I get the exception "Index was outside the bounds of the array." If I only use methods with no parameters, OR DynamicProxy v2, everything works…
Cristian Diaconescu
  • 34,633
  • 32
  • 143
  • 233
0
votes
2 answers

invoking 2 targets with Castle.DynamicProxy

Say I have an interface IInterface. Say I have 2 implementations of the same IInterface (foo & bar). Is it possible to invoke the same method on both targets?
Paperino
  • 935
  • 7
  • 14
0
votes
1 answer

Castle.Core for WindowsPhone71

I would like to use the DynamicProxy from Castle.Core, but I can not because: PM> Install-Package Castle.Core Installing 'Castle.Core 3.2.2'. Successfully installed 'Castle.Core 3.2.2'. Adding 'Castle.Core 3.2.2' to foo. Uninstalling…
Lajos
  • 2,549
  • 6
  • 31
  • 38
0
votes
1 answer

Unable to insert new records using Entity Framework 6 + Code First + Castle Windsor

I know this may be a simple question, but I'm pretty new to architecture and I want to do it right. So, thank you for your comprehension. I'm also new to Castle Windsor and not used with Unit Of Work neither Repository patterns - And I even don't…
0
votes
1 answer

Windsor Method interception (AOP)

I'm trying to create interceptors for specific methods but I'm having a hard time. I can't bind an aspect to a specific method. I create the faicilities most of examples show but it still doesn't work. Can anyone give me an example of how to do…
Allan
  • 21
  • 5