How to construct the Team System Web Access 2005 URL to a file in version control

Grant Holliday asked for an explanation of how a Web Access URL should be constructed to for a file in TFS version control, similar to the work item links explained in the TSWA 2005 FAQ.  Hakan responded with the details, which are shown below.


ItemData is the HtmlEncoded form of the query string, such as “id=10&cs=-1”

  • id: the item ID of the item in source control (you need to know this instead of the file path)
  • cs: changeset number (-1: latest)

For example, if the file id is 151611,

    HtmlEncode(“id=151611&cs=-1”) -> “id%3D151611%26cs%3D-1”

So the URL would then be

We’re planning to provide more friendly URLs in a future version, similar to the wi.aspx approach.

Comments (4)

  1. Buck Hodges on How to construct the Team System Web Access 2005 URL to a file in version control. The…

  2. Ryan Starks says:

    I have a question regarding this.  We are attempting to link source controlled items into our internal wiki.  I can construct the link and it works fine when I have Team web access open in a browser window but if I do not I get the following message null reference message

    "Object reference not set to an instance of an object."

    Is there a way around this?


  3. buckh says:

    Ryan, here’s what Hakan tells me.

    If the user doesn’t have an existing TSWA session, we try to authenticate him by redirecting to the login page. In TSWA 2005, some pages handle this correctly but some don’t. Generally, we can’t handle out-of-flow entry points very well in TSWA 2005. We’ve made some improvement in TSWA 2008.  We’ll hopefully make more changes in Rosario.


Skip to main content