3

I'm getting the following error trying to proxy an Interface (without target) that implements two different generic forms of the same generic interface.

So, I have:

public interface IGenericFoo<T> 
{
    void DoSomething<T>();
}

// this is the interface I'm trying to proxy without target
public interface IFoo : IGenericFoo<MyType1>, IGenericFoo<MyType2>
{
}

I get the following error:

Duplicate element: Castle.DynamicProxy.Generators.MetaMethod

at DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget

Any suggestions? Is there a workaround?

Thanks.

Jeff
  • 35,755
  • 15
  • 108
  • 220
  • looks like a bug unsupported scenario in DynamicProxy. Please submit an issue to issue tracker. – Krzysztof Kozmic Dec 15 '10 at 08:13
  • Slightly related - if I add an OnCreate handler to a interface without target component, the instance comes across as null to the handler. Is this by design? Thanks. – Jeff Dec 15 '10 at 15:42
  • Any thoughts on where I might look if I want to see about fixing this myself? Thanks. – Jeff Dec 20 '10 at 15:23
  • Did you ever get any further with this? I'm encountering this issue on a class which implements `IEnumerable` and `IEnumerable>`. – Lukazoid Sep 10 '14 at 11:35

0 Answers0