使用 TFS 客户端 API 上传文件 [英] Upload a file using TFS Client APIs

查看:42
本文介绍了使用 TFS 客户端 API 上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 asp.net 网页上传文件到 TFS 服务器.使用 TFS API 我从我的网页创建了错误 - 但该错误还需要文件附件才能上传,请告诉我.

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.

推荐答案

在保存之前,您应该能够简单地创建一个 Attachment 对象并将其添加到 WorkItem 上的 Attachments 集合中:

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

这篇关于使用 TFS 客户端 API 上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆