1

I'm trying to read from the public timeline with the TweetSharp library from a silverlight project when I get this exception.

Unhandled Error in Silverlight Application 
Code: 4004    
Category: ManagedRuntimeError       
Message: System.Security.SecurityException ---> System.Security.SecurityException: Security error.
   at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass5.<EndGetResponse>b__4(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace ---
   at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
   at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at Hammock.Web.WebQuery.GetAsyncResponseCallback(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClassd.<InvokeGetResponseCallback>b__b(Object state2)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Twitter throws a 404 for the clientaccesspolicy.xml file but the crossdomain.xml file is fetched just fine.

The code making the request is as follows:

var tweets =
                FluentTwitter.CreateRequest(new TweetSharp.TwitterClientInfo()).Statuses().OnPublicTimeline().AsJson().
                    CallbackTo((sndr, args, state) =>
                                   {
                                       var statuses = args.AsStatuses();
                                       foreach (TwitterStatus status in statuses)
                                       {
                                           _statuses.Add(status);
                                       }
                                   });
            tweets.BeginRequest();

Is this a bug or am I doing something wrong?

Jonas Van der Aa
  • 1,441
  • 12
  • 27

0 Answers0