C# Code to get the Work Item URL

by Xavier Dilip Kumar 18. June 2013 16:48

var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(tfsURL + "/" + collectionName));
var myService = projectCollection.GetService<TswaClientHyperlinkService>();
string wiURL = myService.GetWorkItemEditorUrl(workItem.Id).ToString();

Tags: , ,


An error occurred while initializing a build for build definition xxx: There is not enough space on the disk

by Xavier Dilip Kumar 23. February 2013 13:33

Follow the below steps on the build agents
• Go to Start->Programs->Microsoft Team Foundation Server 2010/ 2012 ->Team Foundation Administration Console
• Select a build agent and click Properties
• Change the working directory from to $(SystemDrive) to D:, E: etc depending upon the free disk drive

Tags: , ,

TFS | TFS 2010 | TFS 2012

TFS Service account permissions on Database

by Xavier Dilip Kumar 2. February 2013 13:15


TFS Service account requires the follwoing permissions on TFS - Share Point DBs

APP Database  Roles & Permissions
SQL Server System Master Public and TFSExecRole
TFS Configuration Public and TFSExecRole
TFS Collection Public, db_datareader, db_datawriter, db_owner and TFSExecRole
TFS Warehouse Public, TFSExecRole and TfsWarehouseDataReader
SharePoint Configuration Public and  db_owner

Tags: ,

TFS | TFS 2010 | TFS 2012

TF14098: Access Denied User [Domain]\User needs Label permission(s) for $/Source

by Xavier Dilip Kumar 8. September 2012 20:14



The users should have project level permission to label any folders and files in version control using visual studio IDE. The error occurs when team project does not have project users/groups permissions set at project level but its set on folders.

Add the users/groups permission at project level.


Tags: , ,


Unable to find appropriate display filter for file extension ".docx". Add a mapping into MimeMap.XML file under App_Data folder.

by Xavier Dilip Kumar 10. August 2012 20:33


Expected behavior in TFS web access as there are no display filter for MS office files. There are only three default display filters configured to open plain text (.CS, .proj etc.) and images on the browser. The display filter is used to display files on the web page. For the other kind of files, TFS web access cannot display them in the web page, instead it provides link for user to download it.


MimeMap.XML location: C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web\App_Data

    <Extension name=".doc" content-type="application/msword"/>
    <Extension name=".pptx" content-type="application/vnd.ms-powerpoint"/>
    <Extension name=".pps" content-type="application/vnd.ms-powerpoint"/>
    <Extension name=".pdf" content-type="application/pdf"/>
    <Extension name=".docx" content-type="application/msword"/>


Tags: , ,


Error 0x800700DF: The file size exceeds the limit allowed and cannot be saved.

by Xavier Dilip Kumar 28. June 2012 18:37


Increase the SharePoint Upload Limit via Central Administration

Open Central Administration --> “Manage Web Applications” --> Select desired web application row (don’t click on the title, just select) --> 
“General Settings” in the ribbon --> Under Maximum Upload Size, change the setting to the desired value (e.g. 150 MB) --> “OK”


If the problem still exist, Apply the following settings in your local box from where you are trying to upload/download the files

1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters
3. In the right pane, right-click the FileSizeLimitInBytes value, and then click Modify (Note: If you cannot see the FileSizeLimitInBytes value,
right-click the blank space in the right pane, click New, click DWORD Value, type FileSizeLimitInBytes, and then click OK).
4. In the Edit DWORD Value box, click to select the Decimal option. In the box under Value data, type a value that is larger than the size of the file that you want to download. Click OK. (Note The default value for the file size limit is 50000000 bytes.)
5. Quit Registry Editor. Restart the box.

Tags: , ,


Error Message: you cannot perform this operation on workspace. domain/id are not the owner of the workspace

by Xavier Dilip Kumar 23. June 2012 13:05


VS cache the login credentials for workspace. When we try login with current credentials still it take old credentials from cache


clear the cache and reload it. Follow below steps to do that:
Step 1: Open VS command prompt.
Step 2: Run below command to clear the local cache.

tf workspaces /remove:*

Step 3: Run below command to set the Owner for respective TFS server

tf workspaces /s:TFS_ServerName

For Windows XP, delete all the contents under:
 C:\Documents and Settings\[USER]\Local Settings\Application Data\Microsoft\Team Foundation\
For Windows 7, delete all content under:
 C:\Users\[User]\AppData\Local\Microsoft\Team Foundation\

Tags: , ,

General | TFS

TF246017: Team Foundation Server could not connect to the database. Verify that the server that is hosting the database is operational, and that network problems are not blocking communication with the server.

by Xavier Dilip Kumar 22. June 2012 15:07

Check whether SQL Server Serices is running.

Tags: ,

SQL Server

How to cleanup/rebuild TFS server cache?

by Xavier Dilip Kumar 19. June 2012 20:10


I have been in situation where the cache clean job doesn’t get enough time to clean up old cache data and the flow of TFS server cache is more than the cache clean up which leads to production server outage and performance issues. The workaround mentioned in this post is expensive! means, It will consume more server resource which will affect the TFS server performance.

The Cache Cleanup can take long time on a very large drive. I would recommand to go with the Recommanded Workaround without affecting the server performance rather than workaround.


1. To redirect the cache to different drive

  • Create a new cache folder in the drive with more free space.
  • Open Properties dialog for the new cache folder
  • On the Security tab, choose Edit --> The Permissions dialog box opens.
  • Choose Add --> The Select Users, Computers, or Groups dialog box opens.
  • Add the local group TFS_APPTIER_SERVICE_WPG, and then choose OK.
  • Select the Modify check box, clear all other check boxes, and then choose OK.
  • Open <TFS Server InstallDIR>\Application Tier\Web Services\web.config file
  • Add a line to the appSettings section

              <add key="dataDirectory" value="new cache folder" />

  • Save and close the web.config file.
  • Wait for sometime (may be 2 mins) for new setting in web.config to take effect
  • Delete the old cache root folder

2. To change Cache Settings limits

  • Open <TFS Server InstallDIR>\Application Tier\Web Services\web.config file

          To specify a percentage of available disk space to fill before old files are removed, add the PercentageBasedPolicy element.

              <add key="PercentageBasedPolicy" value="60" />

          To specify a fixed size in MB for the cache to reach before old files are removed, add the FixedSizeBasedPolicy element.

              <add key="FixedSizeBasedPolicy" value="500" />

          To change the amount of cache to free when removing old files, add the CacheDeletionPercent element.

              <add key="CacheDeletionPercent" value="50" />

  • Save and close the web.config file.
  • Wait for sometime (may be 2 mins) for new setting in web.config to take effect


        <add key="applicationDatabase" value="Data Source=dbserverhere;Initial Catalog=Tfs_Configuration;Integrated Security=True;" />
        <add key="WorkItemTrackingCacheRoot" value="C:\Windows\Temp\TFTemp" />
        <add key="traceWriter" value="false" />
        <add key="traceDirectoryName" value="%TEMP%\\TFLogFiles" />
        <add key="applicationId" value="GUID here" />
        <!-- The new cache folder location. -->
        <add key="dataDirectory" value="new cache folder" />
        <!-- The cache should fill up to 60% capacity of available disk space before old files are removed.-->
 <add key="PercentageBasedPolicy" value="60" />
        <!-- The cache should reach 500 MB before old files are removed. -->
 <add key="FixedSizeBasedPolicy" value="500" />
        <!-- To free 50% of the cache when removing old files -->
 <add key="CacheDeletionPercent" value="50" />

Thinks to know

The default is CacheLimitPercent = 75%
If both CacheLimitPercent and FixedSizeBasedPolicy are set, FixedSizeBasedPolicy wins.
If CacheDeletionPercent is not set, it defaults to 20%
Default cache location:  \%programfiles%\Microsoft Team Foundation Server <Version>\Application Tier\Web Services\_tfs_data

Recommanded Workaround without affecting the server performance

1. To Rebuild the cache without changing Cache Settings limits

  • Create a temp cache folder in the drive with more free space.
  • Open Properties dialog for the new cache folder
  • On the Security tab, choose Edit --> The Permissions dialog box opens.
  • Choose Add --> The Select Users, Computers, or Groups dialog opens.
  • Add the local group TFS_APPTIER_SERVICE_WPG, and then choose OK.
  • Select the Modify check box, clear all other check boxes, and then choose OK.
  • Open <TFS Server InstallDIR>\Application Tier\Web Services\web.config file
  • Comment dataDirectory element if already exist

              <!-- <add key="dataDirectory" value="Current cache folder" /> -->

              Note: Default cache location:  <TFS Server InstallDIR>\Version Control Proxy\Web Services\VersionControlProxy\Data

  • Add a line to the appSettings section

              <add key="dataDirectory" value="temp cache folder" />

  • Save and close the web.config file.
  • Wait for sometime (may be 2 mins) for new setting in web.config to take effect
  • Delete the content in current cache folder (Note: Do not delete the current cache folder, Only the folders and files inside current cache folder should be deleted)
  • Open <TFS Server InstallDIR>\Application Tier\Web Services\web.config file
  • Comment (temp) dataDirectory element

             <!-- <add key="dataDirectory" value="temp cache folder" /> -->

  • UnComment dataDirectory element if already exist

             <add key="dataDirectory" value="Current cache folder" />

             Note: Default cache location: <TFS Server InstallDIR>\Version Control Proxy\Web Services\VersionControlProxy\Data

  • Save and close the web.config file.
  • Wait for sometime (may be 2 mins) for new setting in web.config to take effect

Tags: ,

TFS | TFS 2010 | TFS 2012

Complete list of Web Services

by Xavier Dilip Kumar 18. June 2012 13:56



Note: if no team project collection is specified in the URL, the default collection is assumed


Tags: ,


About the author

My name is Xavier Dilip Kumar Jayaraj and I am a Software Configuration Management Engineer with a background in application development, Build & packaging using Install Shield.

Profile in LinkedIn


Quotes I Like

"Failure will never overtake me if my determination to succeed is strong enough."  - Dr. APJ. Abdul Kalam

"Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it." - Bruce Lee

"Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important." - Bill Gates

"Innovation distinguishes between a leader and a follower." - Steve Jobs


The information provided here is based on my expreriences, troubleshooting and online/offline findings. It can be used as is on your own risk without any warranties and I impose no rights.

Month List