本人用VS2008(C#)新建了一个windows forms control library程序 并添加了service引用,编译通过,但调试运行的时候出错了:
“Could not find default endpoint element that references contract 'ServiceReference1.Service1Soap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. ”service引用:web service application 和 wcf service application 都试用过均是同样的错误。private ServiceReference1.Service1SoapClient dataset_client= new ServiceReference1.Service1SoapClient();//web service
private ServiceReference1.Service1Client dataset_client = new ServiceReference1.Service1Client();//WCF创建服务对象(客户端与服务端的接口);程序很简单在此就不附加代码了(代码应该没有错误,在winform 应用程序上可以运行),有兴趣的大虾们可以自己建立程序试验一下,我相信会出现同样的错误此外我也将 windows forms control library 作为控件添加到 winform应用程序上运行也是出错,实在搞不懂是什么原因!
小弟分不多了,见谅!
“Could not find default endpoint element that references contract 'ServiceReference1.Service1Soap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element. ”service引用:web service application 和 wcf service application 都试用过均是同样的错误。private ServiceReference1.Service1SoapClient dataset_client= new ServiceReference1.Service1SoapClient();//web service
private ServiceReference1.Service1Client dataset_client = new ServiceReference1.Service1Client();//WCF创建服务对象(客户端与服务端的接口);程序很简单在此就不附加代码了(代码应该没有错误,在winform 应用程序上可以运行),有兴趣的大虾们可以自己建立程序试验一下,我相信会出现同样的错误此外我也将 windows forms control library 作为控件添加到 winform应用程序上运行也是出错,实在搞不懂是什么原因!
小弟分不多了,见谅!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货