使用WCF服务时出现问题 [英] Issue while consuming WCF Service

查看:87
本文介绍了使用WCF服务时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在使用wcf服务进入我的应用程序后调用wcf服务客户端时遇到异常。



在ServiceModel客户端配置部分找不到引用合同''DashBoardServiceUI.IDashboardDetailService'的默认端点元素。



谢谢

Kishore

Hi all,

I am getting following exception while calling wcf service client after consuming the wcf service into my application.

Could not find default endpoint element that references contract ''DashBoardServiceUI.IDashboardDetailService'' in the ServiceModel client configuration section.

Thanks
Kishore

推荐答案

这里,类似的问题详述:找不到默认端点元素参考合同 [ ^ ]



为了解决这个问题,y您需要将生成的app.config文件的System.ServiceModel部分复制到正在执行的程序集项目的.config文件(Web应用程序项目的web.config,Windows或控制台项目的app.config)。然后它像魅力一样运行。这是因为WCF不使用类库项目中的app.config文件,而是使用正在执行的程序集项目的.config文件。
Here, similar issue detailed: Could not find default endpoint element that references contract[^]

In order to solve this , you will need copy the System.ServiceModel section of the generated app.config file to the executing assembly project’s .config file (web.config for web application project, app.config for windows or console project) . Then it run like a charm. This is because the app.config file in the class library project is not used by the WCF ,instead the executing assembly project’s .config file will be used.


这篇关于使用WCF服务时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆