I am writing a Windows Service with accompanying \"status tool.\" The service hosts a WCF named pipe endpoint for inter-process communication. Through the named pipe, the
The IP Address was, it turns out, a complete red herring.
The real reason for the exception was invalid Enum values being returned by the WCF service.
My enum was defined thusly:
[DataContract]
public enum MyEnumValues : Byte
{
[EnumMember]
Enum1 = 0x10,
[EnumMember]
Enum2 = 0x20,
[EnumMember]
Enum3 = 0x30,
[EnumMember]
Enum4 = 0x40,
}
It looks fine on the surface.
But the raw status reported by the underlying service was a Byte value of "0," and there was no corresponding Enum value for which to cast it.
Once I ensured that the Enum values were all valid, the tool lit up like a Christmas tree.
When in doubt, assume your WCF data is invalid.