I have a C# class defined as follows:
public class GenericItem<T>
{
public List<T> Items { get; set; }
public DateTime TimeStamp { get; set; }
}
I am creating an instance of this class on my server. I am then trying to pass it over the wire via a WCF service as shown here:
[OperationContract]
public GenericItem<MyCustomType> GetResult()
{
GenericItem<MyCustomType> result = BuildGenericItem();
return result;
}
Everything compiles just fine at this point. When I "update service reference" in my Silverlight app an re-compile, I receive a compile-time error, similar to the following:
MyNamespace.GenericItemOfMyCustomType[extra chars] does not contain a public definition for 'GetEnumerator'
I have no idea why:
- Extra chars are appearing. The seem to change everytime I update the service reference.
- How to actually fix this.
What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…