2
嗨,我想提出一个应用程序,可以提交一个YouTube视频的评论。我正在使用.net框架4.0。c#youtube api error
当我点击一个按钮它吐出这个错误
无法加载文件或程序集“Google.GData.Client,版本= 1.7.0.1,文化=中性公钥= 04a59ca9b0273830”或之一它的依赖关系。定位的程序集清单定义与程序集引用不匹配。 (异常来自HRESULT:0x80131040)
我使用的代码如下
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;
using System.Web;
using System.Net;
using HtmlAgilityPack;
using System.Xml;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.YouTube;
using Google.GData.Extensions.MediaRss;
using Google.YouTube;
的代码的其余部分是
string developerKey;
string username;
string password;
developerKey = "mykey";
username = "my username";
password = "my pass";
YouTubeRequestSettings settings = new YouTubeRequestSettings("youtube app", developerKey, username, password);
YouTubeRequest request = new YouTubeRequest(settings);
Uri videoEntryUrl = new Uri("my vid");
Video video = request.Retrieve<Video>(videoEntryUrl);
Comment c = new Comment();
c.Content = "This is my comment from my app";
request.AddComment(video, c);
该dll文件与.exe文件位于同一文件夹内,并且它仍然出现错误。什么是GAC? – mintuz 2011-03-11 19:12:11
你必须有两个不同的版本。尝试用EXING文件夹中的那些文件替换编译中的文件夹。 – harpo 2011-03-11 19:16:28
仍然没有运气:( – mintuz 2011-03-11 19:18:55