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

help building castle dynamic proxy

So I pulled the source from https://svn.castleproject.org/svn/castle/DynamicProxy/trunk/ Open it up in vs.net 2008 problems: vs.net can't open the assembly.cs assembly signing failed What am I doing, rather NOT doing? Update So I downloaded nant,…
mrblah
  • 99,669
  • 140
  • 310
  • 420
1
vote
0 answers

System.Collections.Generic.KeyNotFoundException with Mono, but not Microsoft's .NET

I found a really strange problem while creating unit tests that only occurs with the Mono runtime (Xamarin on Mac included), but runs fine within Visual Studio. I isolated it as far as I could, and I reached a point that I can't tell if it is a bug…
Rafael Steil
  • 4,538
  • 4
  • 25
  • 30
1
vote
1 answer

How to change a target using Castle DynamicProxy

I am trying to understand Castle's DynamicProxy and the thing I would like to do is to change the target of the generated proxy at runtime. Something like this... using System; using System.Collections.Generic; using System.Linq; using…
Jim
  • 4,910
  • 4
  • 32
  • 50
1
vote
1 answer

Using Autofac with Dynamic Proxy that output message automatic

public interface ILog { void Write(string msg); } public class MyLog : ILog { public void Write(string msg) { Console.WriteLine(msg); } } public interface ICanLog { ILog Log { get; set; } } public interface IMyClass { …
Flash
  • 1,615
  • 4
  • 17
  • 23
1
vote
1 answer

can you use castle dynamic proxies on web services references?

Is it possible to create a dynamic proxy on the a web service reference that has been added to a visual studio project? I've added the web service reference in the normal way and tried to create a dynamic proxy using castle to wrap the method…
Marty Henderson
  • 105
  • 3
  • 9
1
vote
1 answer

Castle Windsor IInterceptor Configuration (Nancy bug)

So I ran into this issue with the Windsor bootstrapper for Nancy. I managed to whip together a small test project where I can reproduce what is going wrong. You can find the project here. What seems to go wrong is this: DynamicProxy only seems to…
Lodewijk
  • 2,380
  • 4
  • 25
  • 40
1
vote
0 answers

access to the Object property after new Mock() leads to NullReferenceException

I have to write some tests using moq framework (https://code.google.com/p/moq/). I want to check if some value can be read correctly from a telerik textbox in some ASP.NET application. Therefore I want to mock the telerik text box and give this mock…
MoCapitan
  • 439
  • 4
  • 9
1
vote
1 answer

Creating interceptors with Autofac and MVC3

I need to create a performance monitoring interceptor that will be hooked up via Autofac. Unfortunately, it's for an MVC3 project, meaning that I'm using Autofac 2.6.3, because Autofac 3 is only compatible with MVC4. As such, I cannot use the…
levelnis
  • 7,665
  • 6
  • 37
  • 61
1
vote
1 answer

Rhino Mocks Exception from Castle Dynamic Proxy When Mocking Generics with Where

I have an exception from Rhino Mocks 3.6.0 and 3.6.1 when mocking the following interface: public interface ic { IComponentConfig Bob() where TImpl : TSvc; } I can confirm that when removing the Generic "where"…
thehumansaredead
  • 525
  • 1
  • 4
  • 7
1
vote
2 answers

Using a DynamicProxy interceptor with dependencies in StructureMap Registry

I have the following code: _container = new Container(x => x.AddRegistry()); - public class ManagerRegistry : Registry { public ManagerRegistry() { var proxyGenerator = new ProxyGenerator(); …
David
  • 3,736
  • 8
  • 33
  • 52
1
vote
1 answer

Castle.DynamicProxy2 generate proxy of delegate type

Is there a way to create a proxy of a delegate type and have it implement additional interfaces in DynamicProxy2 and also being able to intercept calls to the generated delegate? The way i normaly generate proxies throws an exception because…
Patrik Hägne
  • 16,751
  • 5
  • 52
  • 60
1
vote
1 answer

How would I apply an Interceptor to a list of assemblies in a directory?

For example an answer to this question by Mark Seemann was this: container.Register(AllTypes.FromAssemblyInDirectory(new AssemblyFilter(folderPath))); This would register all assemblies in a given directory, including 3rd party assemblies that I am…
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
1
vote
3 answers

How do you inject a Logging interceptor into a Windsor Controller Factory?

How do you add an Exception or Logging interceptor into a Windsor Controller Factory using fluent configuration? In my bootstrapper container I new up my installers to pass in values like assemblyName. In my ControllerInstaller I do this, which I…
OutOFTouch
  • 1,017
  • 3
  • 13
  • 30
1
vote
1 answer

Castle.DynamicProxy2 and Adding a Property at Run Time

I am using Castle.DynamicProxy2 and I am instantiating my proxy as such: private static T GenerateProxy() { ArrayList addtlInterfaces = new ArrayList(); addtlInterfaces.Add(typeof (INotifyPropertyChanged)); addtlInterfaces.Add(typeof…
joshlrogers
  • 1,136
  • 1
  • 11
  • 20
1
vote
1 answer

Intercepting explicit interface implementations with Castle Dynamic Proxy

I am having trouble getting Castle Dynamic Proxy to intercept methods that are explicit interface implementations. I read here http://kozmic.pl/category/dynamicproxy/ that it should be possible to do this. Here are my classes; internal interface…
knick
  • 941
  • 8
  • 17