【发布时间】:2011-06-21 01:06:58
【问题描述】:
我在编译 .NET 4.0 应用程序时收到此错误消息。:
“System.Collections.Specialized.INotifyCollectionChanged”类型在未引用的程序集中定义。您必须添加对程序集 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 的引用。
它说它需要的类是在您将 System 添加到项目引用时定义的。
似乎是说它需要版本 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)
{
}
}
导致问题的是 Iterations 集合。
【问题讨论】:
标签: .net reference dllimport dll