When working with WCF many times, exception massage does not help us solve the problem problem. The above massage is usually a symptom for one of the following problems:
- The return values ββare greater than the value that was defined in the configuration file.
- Problem setting endpoint
- Problem with data serialization
I had a third problem with the enumeration. The problem was that the enumeration was explicitly defined with the values
Public Enum FrequencyEnums EveryTime = 1 OncePerHour = 2 OncePerDay = 3 OncePerWeek = 4 Never = 5 End Enum
And the private property that used this listing was defined as follows
Private m_sendFrequencyID As FrequencyEnums
Now, since the enumeration has no definition of the default value and because the property is not initialized explicitly and because the enumeration value for 0 is not in the enumeration and because the default value for the enumeration, regardless of the options specified, is always 0 When I tried to return an instance of this class to the client, I got this error: The connected connection was closed: the connection was unexpectedly closed
The solution is one of the following:
- Define a value of 0 for enumerations or
- Define the default value for the property from the enumeration values.
- Assign an initial value to a property
My question is: how could I find this error with Microsoft tools, not trial and error?
user130457
source share