【发布时间】:2017-08-03 14:46:34
【问题描述】:
我正在使用 Youtube api v3 并需要 FileDataStore (Google.Apis.Util.Store.FileDataStore)。我有所有必要的 using 指令和 NuGet 包,但我仍然收到“找不到类型或命名空间名称‘FileDataStore’”错误。
相同的代码适用于 Winforms 和 WPF。 UWP 不支持 FileDataStore 吗?有解决办法吗?
UserCredential credential;
using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// This OAuth 2.0 access scope allows for full read/write access to the
// authenticated user's account.
new[] { YouTubeService.Scope.Youtube },
"user",
CancellationToken.None,
new FileDataStore(this.GetType().ToString())
);
}
【问题讨论】:
标签: c# youtube-api uwp google-api-dotnet-client youtube-data-api