Hi
When i am trying to get Tags i am getting above error.
C#
using (var yt = new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = "MyApiKey",
}))
{
StringBuilder htmlTable = new StringBuilder();
var request = yt.Videos.List("snippet");
request.Chart = VideosResource.ListRequest.ChartEnum.MostPopular;
var response = request.Execute();
var objResult = response.Items.ToList();
if (objResult != null)
{
htmlTable.Append("");
htmlTable.Append("Category IdChannel IdChannel TitleVideo TitleDescriptionTagsPublished");
htmlTable.Append("");
foreach (var colum in objResult)
{
htmlTable.Append("");
htmlTable.Append("" + colum.Snippet.CategoryId + "");
htmlTable.Append("" + colum.Snippet.ChannelId + "");
htmlTable.Append("" + colum.Snippet.ChannelTitle + "");
htmlTable.Append("" + colum.Snippet.Title + "");
htmlTable.Append("" + colum.Snippet.Description + "");
htmlTable.Append("" + colum.Snippet.Tags + "");
htmlTable.Append("" + colum.Snippet.PublishedAt + "");
htmlTable.Append("");
}
htmlTable.Append("");
htmlTable.Append("");
PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
}Thanks

Dharmesh SharmaRank #1,974 · 741 reputationPosted Dec 17, 2022, 12:35 PM EST
Which line you are getting this error.
As per my understanding error will come in this line.
so check now.
let me know