Beginner Question – Stream Won’t Start

Feb 26, 2015 at 9:22 PM
I just started working with this a few days ago. I’m trying to get something basic up running as a POC. I cannot get the stream to start. Can someone help and tell me what I’m doing wrong?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tweetinvi;
using Tweetinvi.Streams;

namespace TweetinviPOC
    class Program
        static void Main(string[] args)
            string Consumer = "<removed>";

            string ConsumerSecret = "<removed>";

            string AccessToken = "<removed>";

            string AccessTokenSecret = "<removed>";

            TwitterCredentials.SetCredentials(AccessToken, AccessTokenSecret, Consumer, ConsumerSecret);

            catch (Exception e)

        private static void TwitterStream()
            var stream = Tweetinvi.Stream.CreateSampleStream();
            stream.TweetReceived += (sender, args) =>
            Console.WriteLine("Stream State: " + stream.StreamState.ToString());

Feb 26, 2015 at 11:29 PM
Hello this code is supposed to work.
Can you please use the ExceptionHandler and let me know if there is anything in it?

Feb 26, 2015 at 11:34 PM
Edited Feb 26, 2015 at 11:41 PM
What I said before was not correct. I'm getting a 401 and here are the values.
‡ Tweetinvi.Core.Exceptions.ITwitterException.TwitterDescription.get returned "Unauthorized - Authentication credentials were missing or incorrect." string
    exceptionDetails    "Invalid or expired token." string
I have verified that my clock is correct maybe my token is bad?

Thanks again for your help.
Marked as answer by MrVolition on 2/26/2015 at 3:56 PM
Feb 26, 2015 at 11:56 PM
It was my tokens <facepalm> working now. Love the library!!
Feb 27, 2015 at 12:12 AM
Good, I have not done a lot, but I am happy your fixed this :)

Enjoy Tweetinvi :p