Sharing Enum with WCF Service
Solution 1:
Using the Common library should be fine. Enumerations are serializable and the DataContract attributes are not needed.
See: http://msdn.microsoft.com/en-us/library/ms731923.aspx
Enumeration types. Enumerations, including flag enumerations, are serializable. Optionally, enumeration types can be marked with the DataContractAttribute attribute, in which case every member that participates in serialization must be marked with the EnumMemberAttribute attribute
EDIT: Even so, there should be no issue with having the enum marked as a DataContract and having client libraries using it.
Solution 2:
I must have had some issues with an outdated service reference or something. I went back and created a common library containing the enum, and everything works fine. I simply added a using reference to the service interface's file.
using Common;
[ServiceContract]
[ServiceKnownType(typeof(MyEnum))]
public interface IMyService
{
[OperationContract]
ServiceMethod1( MyEnum e, string sUserId, string sSomeData);
}
and I dropped the following:
[DataContract]
public enum MyEnum{ [EnumMember] red, [EnumMember] green, [EnumMember] blue };
I guess since the enum is referenced via ServiceKnownType, it didn't need to be marked up in the external library with [DataContract] or [Enumerator]