I am using C# and using the YouTube V3 API. I am trying to insert a comment into a Video however whenever I do I receive a exception of "{"Object reference not set to an instance of an object."}"
This happens whenever I run anything similar to the above code:
public void AddComment()
{
CommentThread commentToAdd = new CommentThread();
commentToAdd.Snippet.IsPublic = true;
commentToAdd.Snippet.TopLevelComment.Snippet.TextOriginal = "Test";
commentToAdd.Snippet.VideoId = "kc-LBxBcyG8";
commentToAdd.Snippet.TopLevelComment.Snippet.VideoId = "kc-LBxBcyG8";
CommentThreadsResource.InsertRequest ins = JKYouTube.NewYouTubeService().CommentThreads.Insert(commentToAdd, "snippet");
var insertedComment = ins.Execute();
}
I am comparing this to the google explorer and using the same properties and the explorer actually adds the comments where as my program just fails. https://developers.google.com/youtube/v3/docs/commentThreads/insert
As soon as it reaches the second line of code of
commentToAdd.Snippet.IsPublic = true;
It will just error and continue for every line above.
Any help would be greatly appreciated.