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.

  • Hi Sanjay, it seems that some of your service operations accepts or returns a class that isn't a data contract. You can just use any class, it must be possible to serialize it to a string, transfer it over network and deserialized it in another applications. Data contract classes can do it. Maybe it was your intention and you merely forgot the attribute.

  • In reply to Martin Dráb:

    Thanks Martin.

  • In reply to sanjay singh:

    If it answered your question, please mark it as the verified answer.

  • In reply to Martin Dráb:

    It works.

  • 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.