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"

 

Tags:

TFS

TFS Change the Maxiumum Allowed File Attachment Size

by 4. January 2017 13:58

http://localhost:8080/tfs/DefaultCollection/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx?op=SetMaxAttachmentSize

Max allowed is 2GB.

SetMaxAttachmentSize, ConfigurationSettingsService

Tags:

TFS

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

Tags:

TFS

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)

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

Tags:

TFS

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"

Tags:

TFS

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

Tags:

TFS | Visual Studio

Restore NUGET Packages in Visual Studio Online TFS Continuous Integration Builds

by 16. February 2015 13:25

http://geekswithblogs.net/TarunArora/archive/2014/09/14/auto-restore-nuget-packages-with-tfs-build-the-right-way.aspx

  • Step 1 - Enable NuGet Package Restore

        image

        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. ------------------- 
<RestorePackages>true</RestorePackages>
----------------------

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

3. --------------------
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">  
    <PropertyGroup>
        <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, 
see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
------------------------
  • 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… http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

Tags:

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").

Tags:

ASP.Net | Visual Studio | TFS