开发者

WCF - Common library enum issue - C#

开发者 https://www.devze.com 2022-12-13 16:57 出处:网络
I\'ve got a common library that contains enums that are shared between a WCF Service and a client by means of the DLL.Yes, I know the better way of doing this is to create a service out of my common l

I've got a common library that contains enums that are shared between a WCF Service and a client by means of the DLL. Yes, I know the better way of doing this is to create a service out of my common lib - that's for later.

I'开发者_高级运维ve made a change to my common lib, adding another field to the enum. After compiling, I've updated the DLL's in both the WCF service and my web client.

Initially, I was getting the error:

Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.

This was quickly corrected by removing the check from the service reference configuration on the client, "Reuse types in referenced assemblies".

Now, however I am getting an error referring to the new enum value I added:

Invalid enum value 'TestDataReceived_OK_NoDataWritten' cannot be deserialized into type...

So this leads me to believe that there are two library versions out there, but I'm not sure how to resolve this.

I haven't setup any sort of [DataContract] areas in my service interface. If I need to, some code sample would be useful.

Thank you.


Coming back to see this, I did resolve this by configuring the config files correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消