2015-05-27 56 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;