Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I read a public twitter feed using .Net (on Windows Phone)
    text
    copied!<p>I'm trying to read the public twitter status of a user so I can display it in my Windows Phone application.</p> <p>I'm using Scott Gu's example: <a href="http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx" rel="noreferrer">http://weblogs.asp.net/scottgu/archive/2010/03/18/building-a-windows-phone-7-twitter-application-using-silverlight.aspx</a></p> <p>When my code comes back from the async call, I get a "System.Security.SecurityException" as soon as I try to use the e.Result.</p> <p>I know my uri is correct because I can plop it in the browser and get good results.</p> <p>Here is my relavent code: </p> <pre><code> public void LoadNewsLine() { WebClient twitter = new WebClient(); twitter.DownloadStringCompleted += new DownloadStringCompletedEventHandler(twitter_DownloadStringCompleted); twitter.DownloadStringAsync(new Uri("http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=krashlander")); } void twitter_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { XElement xmlTweets = XElement.Parse(e.Result); //exception thrown here! var message = from tweet in xmlTweets.Descendants("status") select tweet.Element("text").Value; //Set message and tell UI to update. //NewsLine = message.ToString(); //RaisePropertyChanged("NewsLine"); } </code></pre> <p>Any ideas anyone?</p> <p><em>SOLUTION: I finally figured this one out. I had simply forgotten to uncomment the: capability in the WMAppManifest.xml. Once I did that the security exception went away.</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload