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()