Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.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
WCF错误:";字典中不存在给定的键。”;关于初始化客户端代理_Wcf_Silverlight_Wcf Binding - Fatal编程技术网

WCF错误:";字典中不存在给定的键。”;关于初始化客户端代理

WCF错误:";字典中不存在给定的键。”;关于初始化客户端代理,wcf,silverlight,wcf-binding,Wcf,Silverlight,Wcf Binding,我收到以下错误:“字典中不存在给定的键。” 代码仅尝试创建代理客户端连接: FileService.FileServiceClient svc = new CCS.FileService.FileServiceClient(); 堆栈跟踪: at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Syst

我收到以下错误:“字典中不存在给定的键。”

代码仅尝试创建代理客户端连接:

FileService.FileServiceClient svc = new CCS.FileService.FileServiceClient();
堆栈跟踪:

   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at System.ServiceModel.Configuration.ServiceModelSectionGroup.get_Client()
   at System.ServiceModel.Description.ConfigLoader.LookupChannel(String configurationName, String contractName, Boolean wildcard)
   at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
   at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
   at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
   at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
   at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)
   at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
   at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()
   at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
   at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
   at System.ServiceModel.ClientBase`1..ctor()
   at CCS.FileService.FileServiceClient..ctor()
   at CCS.MainPage..ctor()
   at CCS.App.Application_Startup(Object sender, StartupEventArgs e)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
我有一个silverlight 3应用程序,我正在Web应用程序上添加WCF服务。有人知道解决这个问题的方法吗?似乎很难获取绑定信息。

听起来好像加载了错误的Silverlight 2文件,而不是Silverlight 3文件:

要暂时解决此问题,请卸载Silverlight 2 SDK,更新您的服务引用,并重新构建Silverlight应用程序

如果希望Silverlight 2和Silverlight 3应用程序都可以使用您的服务,可以将绑定更改回basicHttpBinding。为此,请编辑包含服务的web项目的web.config文件。然后更新服务引用并重建Silverlight应用程序