I am making reference to a service that exposes an Enum
type in the service namespace. When the proxy is generated the Enum
type is not present. What causes this to occur and how do I resolve?
Note: adding this as a web reference generates the type, as a service reference it does not.
If you are not using the Enum
inside your ServiceContract
- it may not be known. You could try using KnownType
and marking the Enum
as public
with DataContract
and each Enum
member as EnumMember
.
You should also try explicitly assigning values to the Enum
types like this:
[DataContract]
public enum EnumType
{
[EnumMember]
Value1= 0,
[EnumMember]
Value2 = 1
}
instead of...
[DataContract]
public enum EnumType
{
[EnumMember]
Value1,
[EnumMember]
Value2
}