【发布时间】:2016-08-05 23:00:46
【问题描述】:
我正在使用 ms vs express 2012 win 桌面并尝试编译此代码示例https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video
我得到了像 Google.Apis.YouTube.v3、Google.Apis.Authentication 和 Google APIs Client Library 这样的 nuget 包。现在我得到了几百个 dll,其中一些是重复的。
添加了以下参考
我的使用指令:
using System;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Google.Apis;
using Google.Apis.Authentication.OAuth2;
using Google.Apis.Authentication.OAuth2.DotNetOpenAuth;
using Google.Apis.Services;
using Google.Apis.Upload;
using Google.Apis.Util.Store;
using Google.Apis.YouTube;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
编译失败并出现以下错误:
找不到用户凭据(缺少 using 指令?)
GoogleWebAuthorizationBroker 不存在
GoogleClientSecrets 不存在
我需要什么参考或使用指令? GoogleWebAuthorizationBroker 似乎需要 Google.Apis.Auth.PlatformServices - 我有 Google.Apis.Authenication.PlatformServices 参考,没有帮助。
【问题讨论】:
-
您是否在教程中的代码中添加了所有使用?
-
从技术上讲,您只需要添加单个包,它会为您添加您需要的所有内容 PM> Install-Package Google.Apis.YouTube.v3
-
@DaImTo 是的,只是复制了所有内容。好吧,它下载了很多文件和文件夹,很多不同版本的同一个 dll,我添加了其中的几个,但看起来仍然缺少一些东西。 509 个不同的 dll 文件
-
我觉得有些事情不应该下载那么多
标签: c# google-api youtube-api google-api-dotnet-client