title: WCF client proxy exception - "Type cannot be added to list of known types"
body: <p>I am having problems creating WCF client proxy for service code like in this example:</p>
  
  <pre><code>// data classes
  [KnownType(typeof(ClassA))]
  [KnownType(typeof(ClassB))]
  public abstract class BaseClass : Dictionary&lt;string, ITest&gt;
  {
  }
  
  public class ClassA : BaseClass
  {
  }
  
  public class ClassB : BaseClass
  {
  }
  
  
  public interface ITest
  {
  }
  
  // service
  [ServiceContract]
  public interface IService1
  {
      [OperationContract]
      BaseClass Method();
  }
  
  public class Service1 : IService1
  {
      public BaseClass Method()
      {
          ...
      }
  }
  </code></pre>
  
  <p>Whenever I try to create a WCF proxy using "Add Service Reference" in VS it fails and trace log says </p>
  
  <blockquote>
    <p>Type 'WcfProxyTest.ClassA' cannot be added to list of known types since another type 'WcfProxyTest.ClassB' with the same data contract name '<a href="http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfKeyValueOfstringanyType" rel="nofollow noreferrer">http://schemas.microsoft.com/2003/10/Serialization/Arrays:ArrayOfKeyValueOfstringanyType</a>' is already present. If there are different collections of a particular type - for example, List&lt;Test&gt; and Test[], they cannot both be added as known types.  Consider specifying only one of these types for addition to the known types list.</p>
  </blockquote>
  
  <p>I can see what the error message is saying, but is there any other way around this (other than refactoring the classes). I am dealing with a legacy system which has classes written in the same manner as in my example and rewriting them is not an option as this stuff sits in the very core of the system :S</p>
  
  <p>Any ideas? Thanks!</p>