The service "ServiceName"could not be generated.\an Error: Class (ID='1027650') is not a valid parameter or return value.

Check the class attributes. Check whether the contract class have [DataContractAttribute] attribute if not write there and compile and cil your objects.

The above error comes due to missing class attributes.

No Data
  • I also had this error but the class was actually a data contract. After lots of compiling, restarting and CIL compiling to no avail. I found the class mentioned, found the root class in the inheritance hierarchy and compiled foreward from that class. Did a full CIL and it worked.
No Data