Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF Returning Array instead of List EVEN THOUGH Collection Type == Generic.List
    primarykey
    data
    text
    <p>I have project that is a WCF service (.svc) that looks like the following:</p> <pre><code>[ServiceContract] public interface IAdminQueries { [OperationContract] List&lt;Color&gt; GetColors(); [OperationContract] List&lt;PhoneType&gt; GetPhoneTypes(); ... </code></pre> <p>I have another project that is a Web Application. I add a Service Reference to the above Service. Click the Advanced button and select Generic.List from the Collection Type. All seems as it should be.</p> <p>I then build and get errors with the code below:</p> <pre><code> AdminQueriesClient db = new AdminQueriesClient(); List&lt;Color&gt; s = db.GetColors(); </code></pre> <p>Here is the error:</p> <pre><code> Cannot implicitly convert type 'DogLicenseBO.DogLicenseServiceReference.Color[]' to 'System.Collections.Generic.List&lt;DogLicenseBO.DogLicenseServiceReference.Color&gt;' </code></pre> <p>Is something blocking or overriding the normal serialization/deserialization process?</p> <p><strong>EDIT</strong> I have it working again. However, I think I need what I took out though.</p> <p><em>The Fix</em> This all started because I have to convert a VS 2012 project to VS 2010. Lots a great features I was using but have to downgrade. Anyway, one of the References in VS 2012 is Newtonsoft.Json. I am using that in a couple of places. When I took that out in VS 2010 and rebuilt, everything worked. Now I need more testing to see what I can use for the Json serialization instead of Newtonsoft.</p> <p>Any suggestions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload