views:

439

answers:

1

My silverlight application loads data fromt he SQL fine when I build locally but when I upload it to the live site it will just wait for data to be loaded but show no errors. It worked up until yesterday where I fear I may have changed a setting somewhere and now I cant access the data it seems?

UPDATE 1: it seems to be a problem with the service references. Everytime I update them, it will clear the ServiceReferences.ClientConfig file and then the program wont build.

UPDATE 2: I have tried cleaning and building but still the same problem.

UPDATE 3: Found an error when trying to access the service reference on the live site:

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item

+2  A: 

It sounds like your application is waiting for something, does it time out after 30 seconds? If so, check your SQL connection string.

If there is another tier between Silverlight and SQL (such as a web service), then set up a connection test to make sure that Silverlight is actually reaching SQL...

Did you accidentally replace your live web.config file? If so, try restoring the old web.config as it may have a setting that's not compatable with your server.

Re: Update 1:

Is there an error? If so please paste it. Also please paste the config file in question on pastebin and link to it from here.

Re: Update 3:

The error "This collection already contains an address with scheme http." is caused by not telling a WCF service explicitly what address you wish to bind to when there are many to chosoe from. In this case it looks like IIS is using multiple URLs, for example, consider these fictional addresses:

  • www.mysite.com
  • mysite.com

... so the WCF service has no idea which to use unless you tell it.

The solution, to this is to explictly define what URL to use with the following config lines in the web.config (within the system.serviceModel node) of your WCF service.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true">
  <baseAddressPrefixFilters>
    <add prefix="http://www.mysite.com/SomeDirectory/MyService" />
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

Important:

You should update your question title to indicate that WCF is involved in the solution you have created.

nbolton
its not the connection string.thanks for reply
Andy