I have project that is a WCF service (.svc) that looks like the following:
[ServiceContract]
public interface IAdminQueries
{
[OperationContract]
List<Color> GetColors();
[OperationContract]
List<PhoneType> GetPhoneTypes();
...
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.
I then build and get errors with the code below:
AdminQueriesClient db = new AdminQueriesClient();
List<Color> s = db.GetColors();
Here is the error:
Cannot implicitly convert type 'DogLicenseBO.DogLicenseServiceReference.Color[]' to 'System.Collections.Generic.List<DogLicenseBO.DogLicenseServiceReference.Color>'
Is something blocking or overriding the normal serialization/deserialization process?
EDIT
I have it working again. However, I think I need what I took out though.
The Fix
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.
Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…