WCF Metadata contains a reference that cannot be resolved

前端 未结 6 1562
你的背包
你的背包 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:17

    Maybe it will be helpful for someone.

    My issue was in a contract argument, and I discovered it with help of Event Viewer:

    The operation [Name of method] either has a parameter or a return type that is attributed with MessageContractAttribute. In order to represent the request message using a Message Contract, the operation must have a single parameter attributed with MessageContractAttribute. In order to represent the response message using a Message Contract, the operation's return value must be a type that is attributed with MessageContractAttribute and the operation may not have any out or ref parameters.

    So, if you appended more than one arguments, already having [MessageContract] argument, then you'll see error in question. Completely not obvious.

提交回复
热议问题