SaeedP
Well-known member
- Joined
- Oct 21, 2020
- Messages
- 116
- Programming Experience
- 3-5
Hello,
I have installed InstagramApiSharp from NuGet to my project. When I try to enter my account I encounter this expection:
"Unable to login: Object reference not set to an instance of an object."
But I have defined the object reference. Here comes a piece of my code:
Where do I have made a mistake?
thanks,
I have installed InstagramApiSharp from NuGet to my project. When I try to enter my account I encounter this expection:
"Unable to login: Object reference not set to an instance of an object."
But I have defined the object reference. Here comes a piece of my code:
C#:
public static IInstaApi _instaApi;
private static async Task StartInstagram()
{
var userSession = new UserSessionData
{
UserName = "username",
Password = "password"
};
var _instaApi = InstaApiBuilder.CreateBuilder()
.SetUser(userSession)
.UseLogger(new DebugLogger(LogLevel.Exceptions))
.Build();
Where do I have made a mistake?
thanks,