How to set the “default” configuration for a project.

Being a Process Consultant specializing in TFS I teach many companies how to use Team Build.  When you create a new build definition you have the option to set “Configurations to Build”. However, if you leave that value blank the build will build the “default” configuration. The questions I am inevitability ask are “what is the default configuration” and “how do we set the default configuration”?  Well in this post I will show you where it is stored and how to update it for typical Visual Studio 2012 project. Visual Studio projects are msbuild scripts and because of that we can set properties in the actual project files that are going to be sent to msbuild to be compiled.  To change the default configuration you we need to load the project file as xml which is the file format of msbuild.  With the project open in Visual Studio simply right click on the desired project and select “Unload Project” from the context menu.  Once the project is unloaded right click on it again and select “Edit [Project Name]” and Visual Studio will open the file as an xml file we can edit.  Search the file for a “Configuration” element in a property group (it is normally the first group).  It should look similar to this: <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>   This is the line responsible for setting the default configuration of your build.  Simply change “Debug” to the desired default configuration, save the file then right click on project file in Solution Explorer and select “Reload Project”.  After you check in your changes an queue a new build it will be built using this configuration if the “Configurations to Build” is blank in the build definition.

I can't find the Kanban board in Update 2.

  Problem:  I installed Update 2 for TFS but when I click board I don’t see the Kanban board I see the task board.  Solution: Click the board link at the top of the Backlog Page under the "Product Backlog" heading next to "stories". Explanation: The board link at the top left of the page between the backlog and work items links takes you to the task board. But if you click the board link below the "Product Backlog" heading where you enter new User Stories it will take you to the Kanban board.

How to setup a discussion board on your TFS Project Portal

You can set up discussion boards on your SharePoint Project Portal site to share information and discuss topics with other people. Navigate to the Project Portal Click All Site Content at the bottom left of the page Click the Create link at the top of the page If you do not see the Create link you need at least the Design permission From the Communication section select Discussion Board Enter a Name and Description and click Create button

I get an error when I attempt to search my TFS Project Portal

Problem: When I attempt to use the search feature of my TFS Project Portal I get the following error: "Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information." Solution: Configure the "Microsoft SharePoint Foundation search server". Explanation: Open SharePoint 2010 Central Administration Click Manage content databases under the Application Management section Make sure the SharePoint site is selected for Web Application and not SharePoint Central Administration Click the WSS_Content database link Find the Search Server section and select a search server  If your dropdown is disabled you must for configure a search server

How to configure a search server for SharePoint 2010

If you would like to be able to search your TFS Project Portal you must enable a Microsoft SharePoint Foundation Search Service.  This process is for SharePoint 2010 that is installed by TFS during the configuration. Open a command prompt and change to the following directory: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN Run the following command: psconfig.exe -cmd services –install NOTE: This command will take down our TFS while it runs. Open SharePoint 2010 Central Administration Click Manage services on server under the System Settings section Click the Start link next to SharePoint Foundation Search You will be sent to the Configure Microsoft SharePoint Foundation Search Service Settings on server [serverName] Simply scroll down and click the Start button

Team Foundation Build Configuration - HTTP code 500

Problem:  After adding host headers to my TFS Website in IIS my build server fails to connect with the following error:   Solution: Add multipleSiteBindingsEnabled=true  to the serviceHostingEnvironment element in the C:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Message Queue\web.config file on the application tier machine. Explanation: We added host headers to the TFS Website so users would not have to type in the port to reach web access.  After doing so our build would continue to fail.  Updating the web.config corrects the error and allows builds to run.

I get an error trying to run reports on TFS2012 install

Problem: I get the following error when I attempt to view reports: An error has occurred during report processing. (rsProcessingAborted)Cannot impersonate user for data source 'TfsReportDS'. (rsErrorImpersonatingUser)Log on failed. Ensure the user name and password are correct. (rsLogonFailed)For more information about this error navigate to the report server on the local server machine, or enable remote errors  Solution: Verify that the password for the account reporting services is using has not expired. Explanation: In your browser, navigate to http://localhost/reports (from your reporting server machine).Click on Tfs2010ReportDS on the home page. Under the 'Credentials stored securely in the report server' click the Test Connection button. You should see the following message "Log on failed. Ensure the user name and password are correct."Simply reenter the username and password information and test the connection again.

Cannot register assembly during Team Build (and I don't want too)

Problem: I have a solution that contains a project with the "Make assembly COM-Visible" checked and I get the following error when I attempt to run a team build: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (3885): Cannot register assembly "C:\Builds\1\TeamProject\Libraries - CI\bin\Debug\Mydll.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\Mydll' is denied. Solution: Pass "/p:RegisterForComInterop=false" to MSBuild using the MSBuild Arguments process parameter of your build definition. Explanation: The service account running my build agent is not an adminstrator on my build.  Therefore; it does not have permissions to write to the registry to register the COM assembly.  Because this is my build machine I have no desire to have the COM assembly registered on this machine. I simply what the solution to build. When the "Make assembly COM-Visible" is checked the project file is changed to include a target to register the assembly. That target has a condition testing if RegisterForComInterop is true.  By passing the values to MSBuild you are overriding the default value of True with False.  This will allow the project to compile and skip the step to register.

I have to create the same branches in every new team project

Problem: I have to create the same branching structure in several team projects.  I would like a way to automate this process. Solution: Use the tf.exe and tfpt.exe command line tools in a batch file. Explanation: Using the tf.exe and tfpt.exe command line tools you can preform the same task from the command line that you can preform in the IDE.  Using tf.exe and tfpt.exe we can script the creation of the desired branching structure to speed up the process. You can download the Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools from here. The script below creates the Basic Branch Plan from the Visual Studio Team Foundation Server Branching and Merging Guide which you can download from here. The script must by run from a Developer Command Prompt so that tf.exe and tfpt.exe can be found.  Your other option is to update the environment variables for you machine to include the location of tf.exe and tfpt.exe in your path. @ECHO OFF REM If they did not provide arguments show them how to REM use this batch file if "%1" == "" GOTO Usage if "%2" == "" GOTO Usage REM Create a temp workspace to create the branches in. REM This will be deleted at the end tf workspace /new /noprompt temp /collection:%1 REM Before you can create branches you must do a get latest tf get $/%2 REM Create a main folder that will become the main branch of code md %2\Main REM Add this folder to TFS tf add %2\Main /noprompt REM Check in the main folder tf checkin /comment:"Adding main branch" /recursive /noprompt REM Now start creating the other branches REM main to dev tf branch $/%2/Main $/%2/Dev /noget /checkin REM main to release tf branch $/%2/Main $/%2/Release /noget /checkin REM We have to use tfpt from the power tools to convert REM the folder to a branch so we get the new branch icons REM in source control explorer tfpt branches /convertToBranch /collection:%1 /recursive $/%2/Main Echo Deleting temp workspace Echo. tf workspace /delete /noprompt temp REM Remove the directories we created rd %2 /s /q REM Skip usage and just end GOTO End REM Show how to use the script :Usage Echo This batch file will create the default Main, Dev and Release branches Echo for a team project. Echo Requires: Echo Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools Echo. Echo Usage: Echo createBraches collection teamProjectName Echo. Echo collection = http://tfs:8080/tfs/myCollection Echo teamProjectName = the team project name in that collection Echo. Echo createBranches http://tfs:8080/tfs/sandboxcollection teamProjectName :End createBranches.cmd (1.67 kb)