Upload a file using TFS Client APIs

爷,独闯天下 提交于 2019-12-02 09:01:25

问题


I want to upload a file from asp.net webpage to TFS server. Using TFS API I have created bug from my web page - but the bug also needs a file attachement to upload please let me know.


回答1:


You should be able to simply create an Attachment object and add it to the Attachments collection on the WorkItem before you save it:

Dim attachment As New Microsoft.TeamFoundation.WorkItemTracking.Client.Attachment("c:\somefile.txt", "My Comment")
workItem.Attachments.Add(attachment)
workItem.Save()


来源:https://stackoverflow.com/questions/860495/upload-a-file-using-tfs-client-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!