How to open TFS WorkItem in one shot?

I open the work item and go to the "Attachments" tab. I double click on the .doc attachment. Instead of opening the file in Word, instead it launches a browser, which in turn resets the file.

Is there a way to get TFS to run the application directly in Word?

+7
source share
2 answers

Access to the application is carried out from the server at the specified URL:

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

Visual Studio basically executes Shell Exec of this URL, which launches your default web browser.

You have two implementations of the work item form:

  • Desktop: it exec exec
  • web one: you are already in a web browser

So there is no other way, and I doubt that the network has its own tool to shorten this process ...

+4
source

Looking at the AttachFileHandler.ashx HTTP response headers, the β€œproblem” is that the content is returned as a file:

 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 

This is the content-disposition header that forces the Save As dialog, although the browser can simply display the image directly. See Note to 19.5.1 Content-Disposition from w3.org:

If this header is used in the response with the content type of the application / octet stream, the implied assumption is that the user agent should not display the response, but directly enters the "save response as ..." dialog.

I suspect that TFS does this so that it can return any file, regardless of whether the receiving browser can process the content initially, for example, using a plug-in for PDF files. Perhaps it would be possible to modify AttachFileHandler.ashx to change the way it returns?

+3
source

All Articles