title: Unknown types error over WCF service
body: <p>I'm trying to use this method on WCF client:</p>
  
  <pre><code>public interface IOhmioService
  {        
    [OperationContract]
    IEnumerable&lt;Enumerador&gt; GetEnumerador(Type type);       
  }
  
  public class OhmioService : IOhmioService
  {
    public IEnumerable&lt;Enumerador&gt; GetEnumerador(Type type)
    {
       var _obj = (IEnumerador)Activator.CreateInstance(type);
       return _obj.Enumerar();  
    }
  }
  </code></pre>
  
  <p>and Implemented like this:</p>
  
  <pre><code>public IEnumerable&lt;Enumerador&gt; GetEnumerador(Type type)
      {
          dynamic _obj = Activator.CreateInstance(type);
          return (IEnumerable&lt;Enumerador&gt;)_obj.Enumerar();
      }      
  </code></pre>
  
  <p>And it gives me error because of unknown types, but i can't understand why. The return type is known by server and client.I'm only trying to tell from client wich kind of object to create. I'm sure that if I pass the Type parameter as a string for instance and use a select case it will work without problems.
  Is there another way to do generic methods on WCF service? Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>This is the error i get:</p>
  
  <blockquote>
    <p>Type 'System.RuntimeType' wasn't spected with the contract name RuntimeType:<a href="http://schemas.datacontract.org/2004/07/System" rel="nofollow">http://schemas.datacontract.org/2004/07/System</a>'. Trye to use DataContractResolver or add the unknown types staticaly to the list of known types (for instance, using the attribute KnownTypeAttribute or adding them to the list of known types to pass to DataContractSerializer)</p>
  </blockquote>