Tuesday, March 13, 2012

Essential TFS Process Template Modifications

Out-of-the-box TFS 2010 ships with two very solid process templates, and you can install the Scrum 1.0 template and the Scrum for Team Systems 3.0 templates as well.  However, there are two template modifications in the Agile template that are very useful.  The first is to modify the Assigned To field to exclude some of the TFS service accounts and duplicate values.
<FIELD name="Assigned To" refname="System.AssignedTo" >
<ALLOWEDVALUES expanditems="true" filteritems="excludegroups">
<LISTITEM value="[Project]\Project Administrators"/>
<LISTITEM value="[Project]\Contributors"/>
<LISTITEM value="[Project]\Not Assigned"/>
</ALLOWEDVALUES>
<PROHIBITEDVALUES expanditems="true">
<LISTITEM value="Project Administrators"/>
<LISTITEM value="Contributors"/>
<LISTITEM value="Not Assigned"/>
</PROHIBITEDVALUES>
<DEFAULT from="value" value="Not Assigned"/>
<ALLOWEXISTINGVALUE/>
<HELPTEXT>..snip..</HELPTEXT>
</FIELD> 
 
The other two modifications are to create initial states in both the Task and Bug work item types.  This can be done by adding the states in the work item type editor, editing the workflow to add the states, and then republishing the work items back to the server.  The flow on a bug would be modified to Created > Active > Resolved > Closed and the Task flow would be modified to a flow of Created > Active > Closed.

Thursday, March 8, 2012

SQL Server 2012 RTM

SQL Server 2012 went RTM yesterday!  The evaluation is available for free or you can get one of the full versions from MSDN subscriber downloads.  One of the changes I'm excited about is that the Management Studio IDE has been integrated with Visual Studio, so we now have one development IDE for both application and database code.

Monday, February 20, 2012

TFS 2010, Build Definitions, and Powershell

I needed to get a list of build definitions from a TFS 2010 instance as we are planning to migrate to a new server and will not be moving the collection, but only the builds and source files inside the collection. The following Powershell scripts will list out the build definitions for a server:
clear-host

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")


$tfsCollectionUrl = "http://{server}:8080/tfs/{collection}"
$server = new-object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection(New-Object Uri($tfsCollectionUrl))
$buildServer = $server.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer])
$workStore = $server.GetService([Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore])

$workStore.Projects | ForEach-Object {
Write-Host ("Project: "+$_.Name)
$buildServer.QueryBuildDefinitions($_.Name) | select-object {$_.Name, $_.ContinuousIntegrationType} | format-table
}

Thursday, September 1, 2011

IIS 7 and Remote Debugging in .NET (Finding the App Pool Thread ID)

Today I had some fun doing remote debugging on an IIS 7 box running a .NET WCF service and wanted to note a couple of things.  First, you must install the linked download on the server.  Second, make sure your firewall ports are off for remote debugging (or just stop Windows Firewall completely).  And last, you’ll need to know the thread ID of the w3wp.exe process (if you have multiple web sites/apps running on the server).  You can find this by running:

c:\windows\system32\inetsrv\appcmd.exe list wps

It will nicely output the process, thread ID, and application pool name.

WP "756" (applicationPool:DefaultAppPool)

Saturday, July 2, 2011

BRD Lite Rangers HOL–Web deployment task failed

Going through the HOL Lab for the BRD Lite Team Build process template, I received the error “Web deployment task failed” after changing the connection string to remove the ‘sqlExpress’ instance.  Yet it still failed, even when I changed it to run under the Admin account.  After turning on the Diagnostic detail, it turned out to be a different project issue:

image

This was because I had to change the connection string in the web project properties under the Package/Publish SQL tab.  Once I removed the ‘sqlexpress’ value from the Data Source, my build succeeded.

image

Monday, May 23, 2011

TFS 2010 SP1 Installation Issue–TFS_SCHEMA_VERSION

I just completed applying TFS SP1 our production TFS server.  The installation experience was smooth, but I ran into one problem that caused some minor panic and about an hour of research.  The install succeeded, the server restarted, but the TFS Job would not start up, and when trying to connect to TFS via Visual Studio, it threw an error about a mismatch of TFS versions in the database.  In the error log, the following was being logged:

TF53010: The following error has occurred in a Team Foundation component or extension:
Date (UTC): 23/05/2011 23:59:18
Machine: --removed--
Application Domain: TfsJobAgent.exe
Assembly: Microsoft.TeamFoundation.Framework.Server, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727
Service Host: 16ff6530-41b7-4803-8474-7ff80ca3c33f (--removed--)
Process Details:
  Process Name: TFSJobAgent
  Process Id: 2056
  Thread Id: 1584
  Account name: --removed--

Detailed Message: There was an error during job agent execution. The operation will be retried. Similar errors in the next five minutes may not be logged.
Exception Message: The requested schema property TFS_SCHEMA_VERSION did not match the expected value. The server requires the Microsoft Team Foundation Server 2010 (SP1) schema but the database currently implements Microsoft Team Foundation Server 2010 (RTM). (type DatabaseSchemaException)

Exception Stack Trace:    at Microsoft.TeamFoundation.Framework.Server.TeamFoundationDatabaseSettings.ValidateDatabase(TeamFoundationRequestContext requestContext, String connectionString, String expectedSchema)
   at Microsoft.TeamFoundation.Framework.Server.FrameworkSqlResourceComponent..ctor(TeamFoundationRequestContext requestContext, String databaseCategory)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationJobService.AcquireJob(TeamFoundationRequestContext requestContext, Guid agentId, TeamFoundationJobQueueEntry jobToStart)
   at Microsoft.TeamFoundation.Framework.Server.JobRunner.AcquireJob(TeamFoundationRequestContext requestContext, TeamFoundationJobQueueEntry queuedJob)
   at Microsoft.TeamFoundation.Framework.Server.JobApplication.CheckJobQueue()
   at Microsoft.TeamFoundation.Framework.Server.JobApplication.ProcessJobQueueInternal()
   at Microsoft.TeamFoundation.Framework.Server.JobServiceUtil.RetryOperationsUntilSuccessful(RetryOperations operations)

Upon opening SQL Management Studio and right clicking the Properties of the appropriate TFS collection database, sure enough, the version was still contained the value “RTM”.  I changed the value to “SP1” (highlighted below), started the TFS Job service, and the collection servicing started immediately.  Within 5 minutes, the server was up and fully operational. 

image

I don’t know why this had to be done, but there it is.  Hope this helps others who might run into this problem.  Thanks to Stackoverflow for the answer to this.

Thursday, March 17, 2011

Installing TFS 2010 on a SQL Instance

When installing Team Foundation Server 2010 on a SQL Instance today, I ran into a couple of issues that are related to the SQL Browser service.  If the SQL browser service is running, you only need to specify the server and instance name, as “sqlservername\instancename”.  If the browser service is not running, you should specify the server name and port number, as “sqlservername, portnumber”.  The value in the screenshot below did NOT work until I removed the “\tfs” value.

image