Invalid contract attribute for IMetadataExchange

后端 未结 11 1406
走了就别回头了
走了就别回头了 2020-12-25 11:49

I have upgraded a WCF Service to .NET Framework 4.5. After doing so I noticed a blue squiggly line around the IMetaDataExchange in the host config file.

<
相关标签:
11条回答
  • 2020-12-25 12:14

    Could it be that you lost your references when you upgraded the project? I noticed this error when my project containing my client had no reference to my project with my service.

    0 讨论(0)
  • 2020-12-25 12:27

    I added System.ServiceModel to the references for the project and it went away

    0 讨论(0)
  • 2020-12-25 12:27

    I've solved the problem. If you ever change your C# class in Service1.cs and IService1.cs. Also update the name attribute in the service element "<namespace>.<classname>" and contract attribute in the endpoind element "<namespace>.<classname>" in your App.config.

    BTW. sorry for the bad english :)

    0 讨论(0)
  • 2020-12-25 12:28

    IF you running Intellisense on the warning. It will bring up a list for you to choose from you can Explicitly call that member.

    0 讨论(0)
  • 2020-12-25 12:28

    If deleting the .SUO file doesn't work, check your references to ensure that you have the System.ServiceModel reference. That ended up being the issue that brought me here.

    0 讨论(0)
提交回复
热议问题