2015-05-27 55 views
0

当我想用YouTube API编写代码,我在命名空间中得到这些错误C#的Youtube API错误

using Google.Apis.YouTube.v3; 
using Google.Apis.YouTube.v3.Data; 

错误1类型或命名空间名称“V3”不中 命名空间中“Google.Apis.YouTube”(是否缺少程序集 参考?)

错误2类型或命名空间名称“V3”不在 命名空间“Google.Apis.YouTube”存在(是缺少程序汇编 参考?)

看来这“V3”标签不存在,请帮我

+0

愚蠢的问题......但你有没有添加相关的Google API DLL文件到你的项目引用? – Cory

回答

1

为了确保您有正确的库和依赖,试图通过下载Google.Apis.YouTube.v3客户端库的NuGet。这里是你做什么:

enter image description here

,然后输入Install-Package Google.Apis.YouTube.v3到控制台,然后按回车。您应该看到这样的事情:

enter image description here

安装完成后,参考文献应已添加到已打开的项目和所有你需要做的就是添加using语句:

using Google.Apis.YouTube.v3; 
using Google.Apis.YouTube.v3.Data;