Hello, I am developing an application that need to consult multiple RSS and am having a problem that run in OutOfbrowser not happen, but if you run the browser is the error "Security Error". The error occurs when the feedback method OpenReadAsync WebClient class. Can anyone help me? The Code is the following:
1 private void GetDescription(string search)2 {3 WebClient client = new WebClient();4 client.OpenReadCompleted += new OpenReadCompletedEventHandler(client_OpenReadCompleted);5 6 string url = "http://www.WWWWWWWWWWWW.com/feeds/WWWWWWW/" + search;7 client.OpenReadAsync(new Uri(url));8 }9 10 void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)11 {12 if (e.Error == null)13 {14 XDocument doc = XDocument.Load(e.Result);15 }16 }
The error occurs in the method client_OpenReadCompleted I've tried to create the clientaccesspolicy.xml as Tim Heuer writes in http://timheuer.com/blog/archive/2008/04/06/silverlight-cross-domain-policy-file-snippet-intellisense.aspx but not yet I succeeded. What I find strange is, if I use in Ouf Of Browser works.
The Stacktrace error is
[System.Security.SecurityException] = (System.Security.SecurityException: Security error. in System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse (IAsyncResult asyncResult) in System.Net.Browser.BrowserHttpWebRequest. <> c__DisplayClass5. b__4 (Object sendState) ...
Thank you.
I look back.