sexy-proxy
sexy-proxy copied to clipboard
Unable to proxy interface with generics
I may be missing something, but the following class can't be used to create a non-Fody proxy:
public interface IPoison
{
void Foo<T>();
}
When trying to create a proxy using:
Proxy.CreateProxy<IPoison>(async invocation =>
{
await invocation.Proceed();
return null;
});
I receive:
System.TypeInitializationException : The type initializer for 'SexyProxy.Proxy`1' threw an exception.
----> System.TypeLoadException : Method 'Foo' in type 'Test.IPoison$Proxy' from assembly 'Test.IPoison$Proxy, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at SexyProxy.Proxy`1.CreateProxy(T target, Func`2 invocationHandler, ProxyPredicate`1 predicate, AsyncInvocationMode asyncMode)