当我编译我的.NET 4.0的应用程序:缺少类型,但似乎真的是版本不匹配
类型“System.Collections.Specialized.INotifyCollectionChanged”的定义我收到此错误信息未引用的程序集。您必须添加对程序集“WindowsBase,版本= 3.0.0.0,文化=中立,PublicKeyToken = 31bf3856ad364e35”的引用。
当您将系统添加到项目引用时,它说它需要的类是定义的。
这似乎是说它需要一个版本3的参考。我不知道该怎么做。
如果有人有想法,我很乐意听到它。
作为一个方面说明,我现在用的是TFS API和验证码:
// Get the id of the work item that we got from the server (or the work item associated with it)
int workItemId;
// If this is a test run then we need to look up the work item it is running off of
if (notificationEventArgs is TestCaseResultChangedNotification)
{
TestCaseResultChangedNotification testCaseResultChangedNotification = (notificationEventArgs as TestCaseResultChangedNotification);
ITestManagementTeamProject testManagementTeamProject = TFSAccess.Instance.TestManagement.GetTeamProject(testCaseResultChangedNotification.ProjectName);
ITestCaseResult testCaseResult = testManagementTeamProject.TestResults.Find(testCaseResultChangedNotification.TestCaseResultIdentifier.TestRunId, testCaseResultChangedNotification.TestCaseResultIdentifier.TestResultId);
workItemId = testCaseResult.TestCaseId;
foreach (ITestIterationResult testIterationResult in testCaseResult.Iterations)
{
}
}
这是迭代集合导致该问题。
工作完美!谢谢! – Vaccano
那么你究竟做了什么来解决这个问题? –
他添加了对WindowsBase的引用。 –