diff --git a/src/ServiceWire/ProxyFactory.cs b/src/ServiceWire/ProxyFactory.cs index dbba6ec..ada1e55 100644 --- a/src/ServiceWire/ProxyFactory.cs +++ b/src/ServiceWire/ProxyFactory.cs @@ -18,7 +18,7 @@ public static class ProxyFactory public static TInterface CreateProxy(Type channelType, Type ctorArgType, object channelCtorValue, ISerializer serializer, ICompressor compressor, ILog logger, IStats stats) where TInterface : class { - if (!channelType.InheritsFrom(typeof(Channel))) throw new ArgumentException("channelType does not inherit from Channel"); + if (!typeof(Channel).IsAssignableFrom(channelType)) throw new ArgumentException("channelType does not inherit from Channel"); Type interfaceType = typeof(TInterface); //derive unique key for this dynamic assembly by interface, channel and ctor type names