TwitterCredentials doesn't exist in context

May 28, 2015 at 12:18 PM
Hi,

I am newbe to develope webapplication for twitter.

Facing porblem while writting first line of code :
"TwitterCredentials doesn't exist in context"


Please help me to resolve this issue and please share some working code sample too.

Thanks
Kuldeep Singh
Coordinator
May 28, 2015 at 4:14 PM
Hi,

You need to set your credentials before invoking any request.
TwitterCredentials.SetCredentials(...);
Linvi
Jun 1, 2015 at 12:06 PM
Hi,

Yes i am doing the same with my keys like:

public void Authenticate()
{
TwitterCredentials.SetCredentials(
    "My_Access_Token", 
    "My_Access_Token_Secret", 
    "My_API_Key", 
    "My_API_Secret");

authenticated = true;
}

Tried in main class as well as global.asax file.

Code is throwing error on fisrt line itself for "TwitterCredentials"

Please help.

Thanks
Kuldeep Kadyan
Coordinator
Jun 1, 2015 at 12:15 PM
Hi,

Do you mind sharing your project as I do not understand what is going wrong here.

Linvi
Jun 1, 2015 at 1:08 PM
Hi,

Don't have anything in project.

This is the only method...even page load is still blank currently.

Added below namespaces manually:

using Tweetinvi;
using Tweetinvi.Model;
using Tweetinvi.Helpers;
using Tweetinvi.TwitterEntities;
using TweetinCore;
using TweetinCore.Interfaces;
using TwitterToken;
using TweetinCore.Extensions;
using Tweetinvi.Core;
using Tweetinvi.Core.Enum;
using Tweetinvi.Core.Extensions;
using Tweetinvi.Core.Interfaces;
using Tweetinvi.Core.Interfaces.Controllers;
using Tweetinvi.Core.Interfaces.DTO;
using Tweetinvi.Core.Interfaces.DTO.QueryDTO;
using Tweetinvi.Core.Interfaces.Models;
using Tweetinvi.Core.Interfaces.Models.Parameters;
using Tweetinvi.Core.Interfaces.Streaminvi;

While building project getting this error.