R – Error accessing RSS feed from Silverlight with WebClient()

cross-domain-policyrsssilverlightwebclient

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?

Best Answer

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.

[edit added Tim Heuer's links]

Related Topic