title: WebClient.DownloadStringAsync throwing Security Exception in Silverlight
body: <p>First time using Silverlight ever! Following an online tutorial. I'm creating an app which allows the user to search for stories from the Digg website using a WebClient and displays them in a data grid in a Silverlight control.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>private void btnSearch_Click(object sender, RoutedEventArgs e)
  {
      string topic = txtTopic.Text;
  
      string diggUrl = String.Format("http://services.digg.com/stories/topic/{0}?count=20&amp;appkey=http%3A%2F%2Fscottgu.com", topic);
  
      WebClient diggService = new WebClient();
      diggService.DownloadStringCompleted += new DownloadStringCompletedEventHandler(diggService_DownloadStringCompleted);
      diggService.DownloadStringAsync(new Uri(diggUrl));
  }
  
  void diggService_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
  {
      if (e.Error == null)
      {
          DisplayStories(e.Result);
      }
  }
  </code></pre>
  
  <p>Whenever I put a break point on the <code>diggService_DownloadStringCompleted</code> event handler and click the search button <code>e.Error</code> always equals a System.Security.SecurityException with no message and an inner exception of the same type with a message of 'Security error.'. The stack trace is:</p>
  
  <p>at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)</p>
  
  <p>at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)</p>
  
  <p>at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)</p>
  
  <p>at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)</p>
  
  <p>After some heavy googling I've seen people mention a crossdomain.xml file. Not entirely sure what this is but I added one to root directory of the web server running the Silverlight control any and added the following text. didn't make any difference:</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;cross-domain-policy&gt;
    &lt;allow-access-from domain="*" /&gt;
  &lt;/cross-domain-policy&gt;
  </code></pre>
  
  <p>What's going on?</p>