Common WCF Exception : Connection Unexpectedly Closed

后端 未结 12 1017
耶瑟儿~
耶瑟儿~ 2021-02-05 17:19

I have three projects. One is a WCF Services Project, one is a WPF Project, and one is a Microsoft Unit Testing Project. I setup the WCF Services project with a data object th

12条回答
  •  孤街浪徒
    2021-02-05 18:13

    I Found the Answer

    Ok, not sure if it is kewl answering my own question, but here we go. For some reason the enumeration needed to be marked with the [EnumMember] Attributes as below:

    [DataContract]
    public enum Priority
    {
        [EnumMember]
        Low,
        [EnumMember]
        Medium,
        [EnumMember]
        High
    }
    

    Once I did that my tests and services could be called without the error occurring. I'm still not sure why that specific error was displayed. The error doesn't seem to align in any correlation with the functional reason the error occurred, but this fix definitely smoothed everything out.

提交回复
热议问题