Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5962883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:10:06+00:00 2026-05-22T19:10:06+00:00

Question: I Have a WCF test Service with a reference (.net 3.5) on Silverlight

  • 0

Question:

I Have a WCF test Service with a reference (.net 3.5) on Silverlight application and when i make an instance

ServiceReference1.Service1Client client = new Service1Client();

i have the following error:

“The given key was not present in the dictionary.”

The service is correct and in web.config i have something like this

<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>

In a NON silverlight application reference works like a sharm….some ideas to fix it?

PS: the service is a default service:

[ServiceContract]
public interface IService1
{
    [OperationContract]
    void DoWork();
}

public class Service1 : IService1
{
    public void DoWork()
    {
    }
}

MORE INFO

{System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary2.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.EndpointTrait1.CreateSimplexFactory()
at System.ServiceModel.EndpointTrait
1.CreateChannelFactory()
at System.ServiceModel.ClientBase1.CreateChannelFactoryRef(EndpointTrait1 endpointTrait)
at System.ServiceModel.ClientBase1.InitializeChannelFactoryRef()
at System.ServiceModel.ClientBase
1..ctor()
at SilverlightApplication2.ServiceReference1.Service1Client..ctor()
at SilverlightApplication2.MainPage.MainPage_Loaded(Object sender, RoutedEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:10:07+00:00Added an answer on May 22, 2026 at 7:10 pm

    In web.config, which is where the service is supposed to be defined, you have a <system.serviceModel/client> config section – this won’t help you define the client from the Silverlight project.

    You need a client definition on the SL file ServiceReferences.ClientConfig.

    One more thing, SL doesn’t support WSHttpBinding, so that client definition which you have will not work for SL.

    The ServiceReferences.ClientConfig file should be created when you use the Add Service Reference in your SL project to create a reference to the service. If the service uses a binding which is not supported, then the tool should give you an error / warning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using calling web services and using WCF generated service-reference on the client.
I have WCF service which communicates with SqlServer, and want to make frontend with
We have a couple of WCF services hosted in an asp.net application on IIS.
Background This question is in two parts. I have a one-way WCF operation hosted
Question I have an application written in Java. It is designed to run on
Using .Net 3.0 and VS2005. The objects in question are consumed from a WCF
I have created a WCF service in Visual Studio 2010 along with some supporting
I have a WCF service that accepts an object as a parameter that has
.NET Framework: 2.0 Preferred Language: C# I am new to TDD (Test Driven Development).
I have a WCF service that I am deploying in a shared hosting environment.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.