Вопрос:
У меня есть служба тестирования WCF со ссылкой (.net 3.5) на приложение Silverlight и когда я делаю экземпляр
ServiceReference1.Service1Client client = new Service1Client();
у меня следующая ошибка:
"Указанный ключ отсутствует в словаре."
Служба работает правильно, и в web.config у меня есть что-то вроде этого
<client>
<endpoint address="http://localhost:49955/Service1.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="ServiceReference1.IService1" name="WSHttpBinding_IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
В приложении NON silverlight ссылка работает как шарм .... некоторые идеи, как это исправить?
PS: служба является службой по умолчанию:
[ServiceContract]
public interface IService1
{
[OperationContract]
void DoWork();
}
public class Service1 : IService1
{
public void DoWork()
{
}
}
ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ
{System.Collections.Generic.KeyNotFoundException: указанный ключ отсутствует в словаре.
в System.ThrowHelper.ThrowKeyNotFoundException ()
в 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)
в System.ServiceModel.EndpointTrait 1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait
1.CreateChannelFactory ()
в System.ServiceModel.ClientBase 1.CreateChannelFactoryRef(EndpointTrait
1 endpointTrait)
в System.ServiceModel.ClientBase 1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase
1..ctor ()
в SilverlightApplication2.ServiceReference1.Service1Client..ctor ()
в SilverlightApplication2.MainPage.MainPage_Loaded (Отправитель объекта, RoutedEventArgs e)
в MS.Internal.CoreInvokeHandler.InvokeEventHandler (Int32 typeIndex, делегат handlerDelegate, отправитель объекта, аргументы объекта)
в MS.Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}