I have a WCF service project that builds fine, makes an accessible WSDL, and svcutil.exe generates no errors.
I have a "Service Manager" project that access that web service, and to which I have successfully added a Service Reference ABCService.
A third project holds all the POCO objects that I need to pass back and forth - decorated liberally with [DataContract] and [DataMember] attributes.
When I try to build the solution, I see that Reference.cs for the ABCService has methods like this (I have substituted (...) for the full namespaces for brevity):
public (...).Thing SaveThing((...).Thing objThing) {
return base.Channel.SaveThing(objThing);
}
public (...).myCollectionOfThing0mj5ZrAW GetThings() {
return base.Channel.GetThings();
}
The first method, that returns a single Thing, works fine - but I get an error for every MyCollection method:
Error 16 Argument 1: cannot convert from '(...).MyCollection<Thing>' to '(...).myCollectionOfThing0mj5ZrAW'
My collection class is decorated as you'd expect:
[CollectionDataContract]
public class MyCollection<T> : List<T> where T : BaseType
{
// ...
}
I have no idea why it's generating the funky "myCollectionOfThing0mj5ZrAW" name, or why the translation from one to the other is failing
EDIT 1: I have tried using
[CollectionDataContract(Name= "myCollection{0}", ItemName = "{0}")]
to decorate my collection class, and I get the same error but with updated names:
Error 12 Argument 1: cannot convert from '(...).myCollection<(...).Thing>' to '(...).myCollectionThing'
EDIT 2:
Despite having checked the "Reuse types in referenced assemblies", selected the radio button for "specified referenced assemblies", and checking the box next to my POCO assembly:
...the service reference is STILL being generated with unique class names: