需要帮助WCF服务消费



我在IIS上托管了此WCF服务。当我尝试使用以下代码在我的客户端项目中消费它时,我会遵循异常"发送请求时发生错误"

LaunchService.LaunchServiceClient launchServiceClient =
            new LaunchService.LaunchServiceClient(
            new BasicHttpBinding(),
            new EndpointAddress("http:// Service base address"));

如果我将BasicHttpBinding()更改为上述代码中的WebHttpBinding()(如我的web.config文件(,我会得到此错误

" system.typeloadexception:'无法加载类型 来自组装的'System.ServiceModel.webhttpbinding' 'System.ServiceModel.Web,版本= 4.0.0.0,culture =中性, publicKeyToken = 31bf3856ad364e35'。''

使用默认构造函数时,我会得到此错误

" system.platformnotsupportedException:'配置文件不是 支持的。"

启动Service.launchserviceclient lunainservice = new 启动Service.launchserviceclient((;

我尝试更改Web配置文件中的设置,但是其上的任何更改都不会使服务起作用。

有帮助吗?

预先感谢..

我在我的核心项目中添加了.NET Project('具有服务'(的引用

解决方案:删除.NET项目并添加新的核心项目

注意:初始化服务

时必须修改某些实现

最新更新