locked
Can't Get Webclient to work... I'm getting System.Security.SecurityException: Security error RRS feed

  • Question

  • I've tried everything to try and get webclient to work in silverlight.

    protected void getResults(string websiteURL, DownloadStringCompletedEventHandler eventHandler)
                 {
                     WebClient c = new WebClient();
                     c.DownloadStringAsync(new Uri("myurl"));
                     c.DownloadStringCompleted += c_DownloadStringCompleted;//eventHandler; 
                 }
    
                 public void c_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
                 {
                     string s = e.Result;
                 }

    I've tried running it in and out of browser...

    I've tried having the url be localhost...

    I've tried it with digg which has a crossdomain xml file...

    I just can't get it to work :\

    Here is my exception

    {System.Security.SecurityException: Security error.
       at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
       at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
       at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)}

    ALSO, I've even tried to run this example on multiply computers and can't get it to run without throwing the above exception:

    http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-3-using-networking-to-retrieve-data-and-populate-a-datagrid.aspx

    Thursday, December 8, 2011 1:18 PM

Answers

All replies