Joseph Michael Pesch
VP Programming

TFS Download/Modify/Upload Office Field Mappings for Microsoft Project

by 5. January 2017 15:29

cd %programfiles%\Common Files\microsoft shared\Team Foundation Server\12.0

# Download the mapping file

TFSFieldMapping download /collection:http://az-tfs01:8080/tfs/impac /teamproject:apps /mappingfile:C:\tfs\fieldmappingfile.xml

# Upload the mapping file

TFSFieldMapping upload /collection:http://az-tfs01:8080/tfs/impac /teamproject:apps /mappingfile:"C:\tfs\fieldmappingfile.xml"




TFS Change the Maxiumum Allowed File Attachment Size

by 4. January 2017 13:58


Max allowed is 2GB.

SetMaxAttachmentSize, ConfigurationSettingsService



TFS Locate and Delete Unused Custom Fields

by 4. January 2017 12:18

# Get list of all unused fields
witadmin listfields /collection:http://tfs:8080/tfs/collection /unused

# Confirm specific field details
witadmin listfields /collection:http://tfs:8080/tfs/collection /n:FieldName

# Delete field from collection
witadmin deletefield /collection:http://tfs:8080/tfs/collection /n:FieldName



Error Connecting Microsoft Project to TFS Work Items (TF80070)

by 23. December 2016 10:27

TF80070: Team Foundation encountered an error while performing the operation. It is recommended that you save your work and restart the application.

Create winproj.exe.config file with the following contents and put it in the folder contianing winproj.exe (e.g. C:\Program Files\Microsoft Office\Office15)

 <add name="General" value="3" />
 <trace autoflush="false" indentsize="3">
   <add name="winprojExeListener" type="System.Diagnostics.TextWriterTraceListener"
   initializeData="c:\Logs\winprojExeListener.log" />



TFS Customizing Work Item Types

by 21. November 2016 06:40

To customize TFS work item types (i.e. adding custom fields, etc.) you can export the existing work item type definitions to XML files (using the below command line method "witadmin exportwitd"), edit the files and then import back into TFS (using the below command line method "witadmin importwitd").  Editing the XML files can be managed more easily by installing the "Microsoft Visual Studio Team Foundation Server Power Tools" which will then provide you a nice GUI editor inside of Visual Studio (once the power tools are installed simply open one of the exported XML files in Visual Studio and it should display inside the editor).

Navigate to this path (may differ for your version of Visual Studio:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>
Then run the below commands to export the work item type definitions to XML.    

witadmin exportwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /n:"Epic" /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Epic.xml"

witadmin exportwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /n:"Feature" /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Feature.xml"

witadmin exportwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /n:"Product Backlog Item" /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Product_Backlog_Item.xml"

witadmin exportwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /n:"Task" /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Task.xml"

witadmin exportwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /n:"Bug" /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Bug.xml"

At this point you have exported the associated work item types as XML files.
Open each XML file in Visual Studio and edit accordingly.
Then run the below commands to import them back into TFS and apply the updates.

witadmin importwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Epic.xml"

witadmin importwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Feature.xml"

witadmin importwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Product_Backlog_Item.xml"

witadmin importwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Task.xml"

witadmin importwitd /collection:http://tfs01:8080/tfs/COLLECTION_NAME_HERE /p:PROJECT_NAME_HERE /f:"c:\temp\TFS_COLLECTION_NAME_HERE_PROJECT_NAME_HERE_Bug.xml"



Visual Studio Error Loading TFS - Unexpected End of File

by 21. September 2016 17:08

When changing connections between different TFS servers, my Visual Studio seemed to get stuck with an issue where it would always error out with a message "unexpected end of file." and TFS could not load.  The solution was to delete all folders and files from this directory: C:\Users\USERID_HERE\AppData\Local\Microsoft\Team Foundation


TFS | Visual Studio

Restore NUGET Packages in Visual Studio Online TFS Continuous Integration Builds

by 16. February 2015 13:25

  • Step 1 - Enable NuGet Package Restore


        Projects that use MSBuild-Integrated package restore typically contain a .nuget folder with three files:

    • NuGet.Config
    • NuGet.exe
    • NuGet.targets

Since the presence of a NuGet.targets file determines whether NuGet will continue to use the MSBuild-Integrated approach, this file must be removed. Also, as the .nuget\NuGet.exe file is not used by Automatic Package Restore, it likewise can be removed. By default, the NuGet.Config file instructs NuGet to bypass adding package binaries to source control. Automatic Package Restore will honour this as long as you leave this file in place. Note that NuGet.Config only has an effect when using Visual Studio to integrate with Team Foundation Server (TFS). In addition to these files, NuGet modifies the project files in the solution to reference the NuGet.targets file so it can participate in the build process. When migrating to Automatic Package Restore, these references must also be removed.

       Remove the NuGet.exe and NuGet.targets files from the solution's .nuget folder. Make sure the files themselves are also removed from the solution workspace.
       Retain the NuGet.Config file to continue to bypass adding packages to source control.

  • Step 2 – Close Down Visual Studio

        Each project in your solution that has picked up any of the below listed tags in the project properties will need to be removed. Open the project in Notepad and look for the below tags, remove these tags…

1. ------------------- 

2. -------------------
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />  

3. --------------------
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">  
        <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, 
see The missing file is {0}.</ErrorText>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
  • Step 3 – Open the solution and check in the changes

        Once you have made the above listed changes, you are good to check in the changes.

Trigger the  build now, the build server should now be able to successfully resolve the package references…

More details here…


ASP.Net | TFS | Visual Studio

Team Foundation Server (TFS) Building Project with External Assemblies

by 27. June 2013 08:47

This approach to fix the issue with using external assemblies (i.e. assemblies not in the project folder structure).  In this example the project references the "Encompass" assemblies from the "C:\Program Files (x86)\Encompass" folder.  I wanted to use the program file reference so it’s easy to upgrade SDK; however, Visual Studio Project always have relative paths which doesn’t get resolved in TFS Build.  To resolve this I have add new registry key for the Encompass folder path on the TFS build server so that it looks into this location when it compiles any project.  Now I don’t need to change the project file. 

Registry key: HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > .NET Framework > AssemblyFolders

Add new key (in this case "Encompass") and then update the "(default)" string value to be the path to the assemblies (in this case "C:\Program Files (x86)\Encompass").


ASP.Net | Visual Studio | TFS