Reputation: 2026
Using the code example on the Twitterizer website I am trying to post a tweet to twitter with this code:
Dim asyncResult As IAsyncResult = TwitterStatusAsync.Update(
tokens.Tokens,
Tweet.Text,
Nothing,
Timeout,
Function(updateResponse)
If (updateResponse.Result = RequestResult.Success) Then
MessageBox.Show("Tweet Posted")
Else
MessageBox.Show("Error: " & updateResponse.ErrorMessage)
End If
End Function)
But I am getting this exception:
System.NotSupportedException was unhandled by user code Message=Specified method is not supported. StackTrace: at System.Func
4.BeginInvoke(T1 arg1, T2 arg2, T3 arg3, AsyncCallback callback, Object object) at Twitterizer.AsyncUtility.ExecuteAsyncMethod[TResponse,TProperties](OAuthTokens tokens, String s, TProperties properties, TimeSpan timeout, Func
4 methodToCall, Action1 function) at Twitterizer.TwitterStatusAsync.Update(OAuthTokens tokens, String text, StatusUpdateOptions options, TimeSpan timeout, Action
1 function) at myFire_Silverlight._twitter.Status_Post(mf_object_tweet Tweet) at myFire_Silverlight.TweetDialog.OKButton_Click(Object sender, RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags) InnerException:
What am I doing wrong?
Upvotes: 0
Views: 283
Reputation: 2026
Ricky responded to my form post on Twitterizer.net, his post was:
I asked one of the guys who worked on that part of the library (most of it, I believe) and this is what he said ...
hrm, so it's basically two issues... 1. That part of the Silverlight Async library didn't support posting of tweets, I'd only had time to selectively implement SL support to the Async library and 2. The recent changes to the source (Henriks Async Helpers) have removed all SL support from the async libraries as SL doesn't support Func.BeginInvoke.
So, you may need to use the non-async methods and place them inside of your own async event handlers. (That is, if I understand that question and his response correctly.)
Upvotes: 1