title: WCF is Returing Array of Objects of MyClass instead of Generic List
body: <p>I have tried a lot of solutions from the internet. But I am not able to resolve this problem.</p>
  
  <p>I have tried solutions from these links below:</p>
  
  <p><a href="https://stackoverflow.com/questions/13513027/wcf-proxy-returning-array-instead-of-list-even-though-collection-type-generic">WCF Proxy Returning Array instead of List EVEN THOUGH Collection Type == Generic.List</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13298066/wcf-returning-array-instead-of-list-even-though-collection-type-generic-list">WCF Returning Array instead of List EVEN THOUGH Collection Type == Generic.List</a></p>
  
  <p><a href="https://stackoverflow.com/questions/493376/why-does-wcf-return-myobject-instead-of-listt-like-i-was-expecting">Why does WCF return myObject[] instead of List&lt;T&gt; like I was expecting?</a></p>
  
  <p>But I am not able to resolve it. </p>
  
  <p>I have 2 copies of the same wcf service source code "WCFServiceApplication". One is hosted on LAN  on IIS7 and Other one is am running locally in my solution.</p>
  
  <p>The one which is hosted on IIS7 is working fine and returning list of objects. But the one on my local solution. I am trying to reference locally in solution to consume "WCFServiceApplication" functions in one of my local project named "MyProjectLibrary.csproj".</p>
  
  <p>But here i have the problem. It is not giving me the Generic List of my custom class objects.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks</p>
  
  <p>I am Returning the List of below class:</p>
  
  <pre><code>[DataContract(IsReference = true)]
  [KnownType(typeof(Joc))]
  [KnownType(typeof(Stakeholder))]
  [XmlInclude(typeof(JocStakeholder))]
  public class JocStakeholder
  {
      [DataMember]
      public long ID { get; set; }
  
      [DataMember]
      public virtual Joc joc { get; set; }
  
      [DataMember]
      public virtual Stakeholder stakeholder { get; set; }
  
  }
  </code></pre>
  
  <p>Joc and Stakeholder are 2 other classes. Actually, these are code first entities.</p>
  
  <p>And My interface has this function:</p>
  
  <pre><code>[ServiceContract]
  public  interface IService
  {
      [OperationContract]
      public IList&lt;JocStakeholder&gt; GetJocStakeHolders();
  }
  </code></pre>