gpt4 book ai didi

c# - 未找到来自 google api 的 UserCredential 类

转载 作者:太空宇宙 更新时间:2023-11-03 23:17:58 24 4
gpt4 key购买 nike

我使用 ms vs express 2012 win 桌面并尝试编译此代码示例 https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video

我得到了 nuget 包,例如 Google.Apis.YouTube.v3、Google.Apis.Authentication 和 Google APIs Client Library。现在我有几百个 dll,其中一些正在复制。

添加了以下引用

enter image description here

我的使用指令:

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;

编译失败,出现以下错误:

UserCredential can not be found (missing using directive?)

GoogleWebAuthorizationBroker does not exist

GoogleClientSecrets does not exist

我需要什么引用或使用指令? GoogleWebAuthorizationBroker 似乎需要 Google.Apis.Auth.PlatformServices - 我有 Google.Apis.Authenication.PlatformServices 引用,没有帮助。

最佳答案

我们大约 3 年前就停止使用 DotNetOpenAuth 和 Google.Apis.Authentication(https://www.nuget.org/packages/Google.Apis.Authentication/ 已过时)。请注意 https://developers.google.com/youtube/v3/code_samples/dotnet#upload_a_video 中的示例实际上使用了正确的用法。

我建议您清理项目并重新安装 YouTube NuGet 包,它会为您安装所有正确的依赖项。

关于c# - 未找到来自 google api 的 UserCredential 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36622282/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com