Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error accessing RSS feed from Silverlight with WebClient()

I'm downloaded the code from John Papa's book here: http://silverlight-data.com/

and am sucessfully running the Chapter 7 example which allows you to press

a button and it reads RSS from digg.com and then displays it.

So, then I replaced the digg URL

http://services.digg.com/stories/topic/microsoft/?appkey=http%3A%2F%2Fwww.silverlight-data.com&count=20]

with my RSS feed:

http://tanguay.info/web/rss

but I get this error on the DownloadStringCompleted event:

Result 'e.Result' threw an exception of type 'System.Reflection.TargetInvocationException' Error = {System.Security.SecurityException ---> System.Security.SecurityException: Security Error bei System.Net.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) bei System.Net.BrowserHttpWebRequest.<>c__DisplayClass5.

I tried other RSS feeds, e.g.: http://news.google.com/nwshp?hl=en&tab=wn&output=rss

and I get the same security error.

What can I do to avoid getting these errors so that I can consume these feeds from Silverlight?

like image 756
Edward Tanguay Avatar asked Nov 24 '25 06:11

Edward Tanguay


2 Answers

If you try to access a website/url that differs from the url your silverlight application is run under you will need to set up a cross site policy file or access a site that has one allowing access.

  • Silverlight Cross Domain Policy File Checker
  • Silverlight cross domain policy file helpers

[edit added Tim Heuer's links]

  • HOW TO USE CROSS DOMAIN POLICY FILES WITH SILVERLIGHT
  • WORKING WITH SYNDICATED DATA
like image 98
Aaron Fischer Avatar answered Nov 27 '25 04:11

Aaron Fischer


Also please see http://silverlight.net/learn/learnvideo.aspx?video=65672 and http://silverlight.net/learn/learnvideo.aspx?video=47174

like image 31
Tim Heuer Avatar answered Nov 27 '25 03:11

Tim Heuer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!