Hardi
Hardi

Reputation: 21

WCF Exception : There was an error while trying to deserialize parameter

My WCF service is developed in .Net 3.0 and developed application which is consuming WCF in 3.5. When I try to consume my WCF then I am getting below error --

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter criteria. The InnerException message was 'Invalid enum value 'Positions' cannot be deserialized into type 'SecurityContents'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. Please see InnerException for more details."

Please help me out in this.

Upvotes: 2

Views: 1923

Answers (1)

chief7
chief7

Reputation: 14373

This error means there is a new SecurityContents enum value of "Positions" that your client doesn't know about. You likely need to update your service reference.

enter image description here

I've also seen this if you Reuse types in referenced assemblies. Try unchecking this.

enter image description here

Upvotes: 1

Related Questions