Tweetsharp .NET library not working online

445 Views Asked by At

I've been using Tweetsharp library to post to Twitter for over a year now. The library suddenly stopped working on my online website 2 weeks ago. However, when i run the code locally, the library is working perfectly.

    Dim TwitterConsumerKey = "XXX"
    Dim TwitterConsumerSecret = "XXX"
    Dim TwitterToken = "XXX"
    Dim TwitterTokenSecret = "XXX"
    Dim twitter = New TwitterService(TwitterConsumerKey, TwitterConsumerSecret, TwitterToken, TwitterTokenSecret)

    Dim sto = New SendTweetOptions
    Dim msg = tweet

    sto.Status = msg
    Dim twitterStatus = twitter.SendTweet(sto)
    If twitterStatus IsNot Nothing Then
        'tweet sent
        'Hitting this part Locally!
        Return True
    Else
        Return False
        ' tweet failed
        'Hitting this part Online!
    End If

When i run this code on my localhost, i am able to post on twitter. Doesn't work online. Any suggestions?

Update: Same issue with TweetMoaSharp

2

There are 2 best solutions below

0
Rami Zebian On BEST ANSWER

You should update your .NET framework to version 4.6.0 and above.

0
albattran On

Not sure if you have figured out the problem. Twitter removed support for legacy TLS versions on July 25th

https://twittercommunity.com/t/removing-support-for-legacy-tls-versions-1-0-1-1-on-twitter/126648