English 中文(简体)
如何一次性打开 TFS 工作项目附件?
原标题:How to open a TFS WorkItem attachment in one shot?
  • 时间:2012-05-24 22:36:18
  •  标签:
  • tfs

我打开一个工作项, 并进入附件标签。 我双击. doc 附文。 它不是用 Word 打开文件, 而是从浏览器上跳动, 而浏览器反过来又把文件拖下水 。

是否有办法让 TFS 直接在 Word 中运行附件?

问题回答

从服务器通过指定的 URL 访问附件 :

http://mytfs/tfs/default/WorkItemTracking/v1.0/AttachFileHandler.ashx?FileID=115&FileName=mydoc.doc

视觉工作室基本上使用此 URL 的 Shell Exec, 开始您默认的 Web 浏览器 。

您有两个执行工作项目表格:

  • Desktop one: it does a shell exec
  • web one: you re already in the web browser

因此没有其他办法,我怀疑网络上有一个定制工具 来缩短这个过程...

查看附件FileHandler.ashx的 HTTP 反应头“ 问题” 是因为内容正以文件形式返回 :

HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 11688
Content-Type: application/octet-stream
Server: Microsoft-IIS/7.0
X-AspNet-Version: 4.0.30319
content-disposition: filename=Screenshot.png
X-Powered-By: ASP.NET
Date: Fri, 17 Aug 2012 08:51:44 GMT

s content-diposition header is forcing a save As 对话框,尽管浏览器可以直接显示图像。见上的说明,http://www.w3.org/Protocols/rfc2616/rfc261616-sec19.html#secc2616-sec19.html#sec19.5. 1, rel=“nofolfol”>19.5.1 内容-discposition 来自 w3.org:

如果使用此信头响应应用程序/ oct- 流内容类型, 隐含的建议是用户代理不应显示响应, 而是直接输入保存回复为... 对话框 。

我怀疑TFS是这样的, 这样它就可以返回任何文件, 不论接收的浏览器能否本地处理内容, 比如 PDF 使用插件。 也许可以修改附件FileHandler. ashx 来改变它返回内容的方式?





相关问题
Why not use TFS as a build / CI solution?

Currently our build solution is set up using TFS + MS Build scripts. TFS is also being used as a CI server. I ve seen several posts on this site telling people about other CI solutions. Are there ...

Get files from TFS under Linux [closed]

is there a free (command line) tool for linux which with I can get all files from a TFS-Repository (no Check in / Check out required - only get actual version)?

upgrading tfs 2008 sp1 to use sql server 2008

I have an instance of tfs 2008 supported by sql server 2005. I want to change the sql server machine by doing a restore based move. I also want to change the version of sql server to 2008. I know ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

TFSReg in 2010 Beta 2?

does anybody know what is the equivalent of the TFSReg.exe command-line tool in 2010 Beta 2? I cannot find it anywhere, I searched the entire Program Files tree. Was it renamed? Moved? Replaced by ...