title: CommunicationException on Asynchronous callback for web service called from Silverlight app
body: <p>I am working with another coder on a website that is accessing SQL Server (2008 Express) through some web services he created (involving mostly LINQ to SQL), and the UI is in Silverlight.  I've been working on another part of the system, but just got his latest code, and am trying to run it on my machine, but am getting an error.</p>
  
  <p>It is a CommunicationException on a line in the reference.cs file, the EndXXX method of the web service:</p>
  
  <pre><code>// This is for a Ping method we created just to trouble shoot- it behaves the same.
  public string EndPing(System.IAsyncResult result) {
  
      object[] _args = new object[0];
  
      // Next line throws Communication Exception
      string _result = ((string)(base.EndInvoke("Ping", _args, result)));
      return _result;
  }
  </code></pre>
  
  <p>The error message is:</p>
  
  <p>"An error occurred while trying to make a request to URI '<a href="http://localhost:1233/SummitService.svc" rel="nofollow noreferrer">http://localhost:1233/SummitService.svc</a>'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. Please see the inner exception for more details."</p>
  
  <p>The whole stack is on my local machine, so I shouldn't be needing to make any cross-domain calls.  We looked through all the configuration code we could find (web.config, ServiceReferences.ClientConfig), to change all the references to his machine to mine.  We're both pretty new to all these technologies, so we've run to the end of our knowledge.</p>
  
  <p>Does this ring any bells for anyone?</p>
  
  <hr>
  
  <p><strong>UPDATE</strong>  </p>
  
  <p>So I have done some trouble shooting, and discovered that if I enter the localhost address of the aspx page that starts this whole thing, it loads fine, and I see the data from the webservice on the page. It is only when I am debugging that I get this error.</p>
  
  <p>I also noticed that when I try and debug the page, it is loading the file location-- D:\projects\etc -- into the browser and not going through localhost. And it is actually loading the .html test page in the project, even though I have set the .aspx page as the start page.</p>
  
  <p>So it looks to be something to do with the project settings or perhaps VS2008 settings, and not a configuration issue like I first supposed. Does anyone have any other suggestions?</p>