Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 找不到引用协定的默认终结点元素。。。但应用程序仍然有效_C#_Wpf_Wcf - Fatal编程技术网

C# 找不到引用协定的默认终结点元素。。。但应用程序仍然有效

C# 找不到引用协定的默认终结点元素。。。但应用程序仍然有效,c#,wpf,wcf,C#,Wpf,Wcf,我目前正在开发一个WPF应用程序,使用另一个项目来调用WebService。 当我尝试构建时,会出现以下错误: 找不到引用协定的默认终结点元素 中的“VisitorRegistrationWebService.VisitorRegistrationWebServiceSoap” ServiceModel客户端配置部分。这可能是因为 找不到应用程序的配置文件,或者因为 在客户端中可以找到与此契约匹配的端点元素 元素 我的webservice项目中的app.config与我的WPF项目中的app.c

我目前正在开发一个WPF应用程序,使用另一个项目来调用WebService。 当我尝试构建时,会出现以下错误:

找不到引用协定的默认终结点元素
中的“VisitorRegistrationWebService.VisitorRegistrationWebServiceSoap” ServiceModel客户端配置部分。这可能是因为 找不到应用程序的配置文件,或者因为 在客户端中可以找到与此契约匹配的端点元素 元素

我的webservice项目中的app.config与我的WPF项目中的app.config完全相同

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="VisitorRegistrationWebServiceSoap" />
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="http://localhost/webservices/VisitorRegistrationWebService.asmx"
      binding="basicHttpBinding"   bindingConfiguration="VisitorRegistrationWebServiceSoap"
      contract="BasicVisitorRegistrationWebService.VisitorRegistrationWebServiceSoap"
      name="VisitorRegistrationWebServiceSoap" />
</client>
</system.serviceModel>
</configuration>


奇怪的是,我可以运行项目并使用Web服务获取数据,但无论我清理和重建解决方案多少次,错误都不会消失。

在错误消息中,合同名称是“VisitorRegistrationWebService.VisitorRegistrationWebServiceSoap”


在端点配置中,contract=“BasicVisitorRegistrationWebService.VisitorRegistrationWebServiceSoap”

删除引用并将其重新添加到回复中,但已经尝试过了