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
0 answers

Duplicate type name within an assembly (with NSubstitute)

Since this morning, our CI build failed due to surprising "System.ArgumentException : Duplicate type name within an assembly." exceptions during our tests execution. (note: our tests project built in .NET (4.6) using references to NUnit (3.9.0.0)…
yi.han
  • 369
  • 4
  • 8
0
votes
2 answers

Getting the value of a generic property at run time

I am using proxies and intercepts for logging purposes. One of the attributes I want to log is message ID from rabbit MQ. We are using the following object: namespace MassTransit { public interface ConsumeContext : ConsumeContext,…
Simon Nicholls
  • 635
  • 1
  • 9
  • 31
0
votes
1 answer

Get implemented method when intercepting from an interface

I am intercepting the methods on an interface because I want to be sure my pre-invoke code is run for all public methods of any given implementation. I know I could do method interception, but that makes configuration harder and risks new methods in…
Mark Bostleman
  • 2,185
  • 3
  • 25
  • 32
0
votes
2 answers

Castle Dynamic Proxy not working?

I have the following class: public class MyTest { public void Test() { } } and I created the following interceptor: public class MyInterceptor : IInterceptor { public void Intercept(IInvocation invocation) { …
SledgeHammer
  • 7,338
  • 6
  • 41
  • 86
0
votes
1 answer

Dynamics CRM 2016 PluginProfiler System.TypeLoadException

I'm having problems debugging my assembly using the PluginProfiler supplied with the PluginRegistrationTool. Once I mark the step as profiling and trigger it (Create an account) it shows the following error message: Unhandled Exception:…
Simon
  • 1,244
  • 8
  • 21
0
votes
0 answers

Castle.Core.4.1.1 to .NET 4.5.2

In VS2015 I have a .NET 4.5.2 console app and I when I try to install nuget package Castle.Core 4.1.1 I get this weird error: Could not install package 'System.Collections.Specialized 4.3.0'. You are trying to install this package into a project…
javros
  • 825
  • 10
  • 31
0
votes
1 answer

[Castle.DynamicProxy]The created proxy object does not have properties of original object set correctly

I'm new here and hope my first question does not confuse anyone. I am using Castle Windsor and Castle DynamicProxy together, in order to integrate AOP with IOC, so that I can implement a logging service (and auditing, etc.) with will intercept all…
0
votes
1 answer

Easiest way to check if method is auto-implemented by Castle DynamicProxy

I'm looking for the easiest way to check if a method on my proxy has been auto-implemented by DynamicProxy. That is, let's say when registering my component, I added some AdditionalInterfaces, and in my interceptor, I only want to intercept the…
Jeff
  • 35,755
  • 15
  • 108
  • 220
0
votes
1 answer

c# how to stop exception from bubbling up

when exception is thrown in my controller, action's are getting executed again and again, when error is thrown this cycle is going on. try { LogManager.Info("Call:" + invocation.TargetType.Name + "::" +…
Nikki
  • 409
  • 1
  • 5
  • 15
0
votes
1 answer

Dynamic proxy generation only for singletons?

I am working on an implementation of log interceptor using Castle Dynamic Proxy and StructureMap, so in my dependency registry I tell to StructureMap to decorate all instance of TrafficSourceRepository with a LoggingInterceptor. var proxyGenerator…
ale
  • 10,012
  • 5
  • 40
  • 49
0
votes
1 answer

When method is called select which delegate is proper for it

This is function which checks which delegate should be bound to which method: Description is here private static bool IsEquivalent(Delegate d, MethodInfo method) { var dm = d.Method; if (!method.ReturnType.IsAssignableFrom(dm.ReturnType)) …
Simon
  • 1,955
  • 5
  • 35
  • 49
0
votes
1 answer

How can I mixin attributes with Dynamic Proxy defined on mixin instances?

I have following mixin defined: public interface IMixin { string SomeProperty { get; set; } } public class Mixin : IMixin { [SomeAttribute] public string SomeProperty { get; set; } } This gets injected with the following "proxy…
user57508
0
votes
3 answers

No base class problem, How to use Castle.DynamicProxy Mixin in this particular case?

I have a 3rd party badly designed library that I must use. It has all sorts of types it works with, we'll call them SomeType1, SomeType2 etc. None of those types share a common base class but all have a property named Value with a different return…
the_drow
  • 18,571
  • 25
  • 126
  • 193
0
votes
1 answer

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…
Jeff
  • 35,755
  • 15
  • 108
  • 220
0
votes
1 answer

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…
joniba
  • 3,339
  • 4
  • 35
  • 49