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?
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 ...
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.)