我想将文件附加到bug
类型的工作项。在将错误详细信息保存到服务器时,我有这个附件。
答案 0 :(得分:8)
TeamFoundationServer server = TeamFoundationServerFactory.GetServer("TFSRTM08");
WorkItemStore store = (WorkItemStore)server.GetService(typeof(WorkItemStore));
WorkItem workItem = store.Projects["ABC"].WorkItemTypes["Bug"].NewWorkItem();
//Set other work item properties.
workItem.Attachments.Add(new Attachment("C:\Temp\MyAttachment.txt", "Comment About Attachment"));
workItem.Save();
答案 1 :(得分:0)