2

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

Sinan Noureddine
  • 495
  • 5
  • 16
  • Which version of TweetSharp are you using? Have you tried the [tweetmoasharp](https://github.com/Yortw/tweetmoasharp) fork? – Andrew Morton Aug 08 '19 at 17:21
  • @AndrewMorton – Rami Zebian Aug 09 '19 at 07:14
  • @AndrewMorton Same issue for tweetmoasharp...Just tried it – Sinan Noureddine Aug 09 '19 at 12:29
  • No idea about TweetSharp but you may want to look into TweetInvi https://github.com/linvi/tweetinvi – imlokesh Aug 09 '19 at 12:51
  • Having same problem. Local machine is Windows 10 and machine with issue is Server 2012 R2. Wondering if an update to Server 2012 R2 caused the issue? – Wavel Aug 12 '19 at 18:22
  • @Wavel could possibly be the .net framework version. It is no more working on version 4.5.2. It works on version 4.6.0 onwards. Also, it might be related to a twitter api update regarding tls support https://twittercommunity.com/t/removing-support-for-legacy-tls-versions-1-0-1-1-on-twitter/126648 Let me know if you find any solution. – Rami Zebian Aug 14 '19 at 16:13
  • @RamiZebian Updated to linq2twitter and framework 4.7 and everything is working. – Wavel Aug 15 '19 at 17:18

2 Answers2

1

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

albattran
  • 1,887
  • 1
  • 12
  • 16
1

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

Rami Zebian
  • 539
  • 1
  • 5
  • 23