WCF Metadata contains a reference that cannot be resolved

前端 未结 6 1566
你的背包
你的背包 2020-12-11 02:17

I\'ve spent a couple of hours searching about this error, and I have tested almost everything it\'s on Google.

I want to access a service using TCP, .NET4 an

6条回答
  •  执笔经年
    2020-12-11 03:02

    I received the same error while attempting to update an existing service reference. It turns out I had data contracts with the same name within the same namespace. Further investigation yielded the real error:

    DataContract for type [redacted] cannot be added to DataContractSet since type '[redacted]' with the same data contract name 'DocumentInfo' in namespace '[redacted]' is already present and the contracts are not equivalent.

    I changed the DataContract to provide a name for one of the classes.

    [DataContract(Namespace = "urn:*[redacted]*:DataContracts", Name = "SC_DocumentInfo")]
    

    I'm posting this here in case it might help someone with the same issue.

提交回复
热议问题