Monday, June 22, 2009

TFS 2010 Setup: Gotchas

I'm sure I missed a step somewhere during setup but...so the search engines catch 'em, I'm going to post my TFS/VSTS 2010 setup missteps below:

Issue: "TF255147: The following server that is running SQL Server is not listening on the expected TCP port: SERVER"
Resolution: Open SQL Server Configuration Manager. Under SQL Server Network Configuration, Protocols for MSSQLSERVER, right-mouse Enable TCP/IP. Restart SQL Server. Re-run TFS configuration wizard.

Issue: "TF255282: Windows SharePoint Services 3.0 cannot be installed. The program is already installed on this server"
Resolution: Open up Add/Remove Programs (or "Programs and Features" under Win2k8 Server) and remove Microsoft Windows SharePoint Services 3.0. Re-run TFS configuration wizard.

Issue: Couldn't get Full-Text search within SQL 2008 to install.
MSI (s) (14:AC) [00:03:21:091]: Source is incorrect. Unable to open or validate MSI package D:\Setup\sql_engine_core_shared.msi.MSI (s) (14:AC) [00:03:21:093]: Note: 1: 2203 2: D:\Setup\sql_engine_core_shared.msi 3: -2147287037 MSI (s) (14:AC) [00:03:21:093]: Source is incorrect. Unable to open or validate MSI package D:\Setup\sql_engine_core_shared.msi.Please insert the disk: Please insert next disk
Resolution: I'm installing on a VPC so I simiply download ISO installs, "Capture ISO image..." from the CD menu of the VPC and install. Works great...usually. In this case, for some reason, the installation would get 2/3rds to completion and die with very innocuous errors. I kept coming up empty searching for "error" within the 500k MSI log file. Finally stumbled onto something referring to "Unable to open..." having something to do with subst.exe and network or simulated mapped drives. I expanded the ISO with MagicISO, copied it to the VPC hard drive and wala, no more issue. That was a good 6 hours of struggle.

Friday, June 12, 2009

Overriding the default assembly output directory in Team Build

By default, Team Build (MSBuild-driven) wants to output compiled assets (assemblies, config, exe's, etc.) to a flattened ..\Binaries\Release|Debug directory. I had a client desiring to package up these assets in their relative, normal output directories into an MSI using WiX.

Fortunately, there's a simple directive to set within the TFSBuild.proj file such that the individual project OutDir is honored:

Set this within the main PropertyGroup element for your build. Unless you're performing a custom check-out, you'll also need to turn off read-only attributes set during the Get from version control. Update this attribute in the AfterGet target using an Exec task:

Wednesday, June 10, 2009

Agile with TFS Presentation Follow-up

Thanks for everyone attending my "Implementing an Agile Software Development Process with Team Foundation Server (TFS)" presentation today. We enjoyed some good discussion. I had a few TFS-related questions pop up which I thought I'd address in a post:

Q. Is it possible to fail the build but only if a specific test fails? So, let's say we have 3 tests. If Test01 or Test02 fail, fail the build. If Test03 fails, don't fail the build.

A. Not that I'm aware of. If any test fails in a build but compilation succeeded, that build lists a state of Partially Succeeded. With TFS 2008 SP1, we received a property to modify or control this behavior: TreatTestFailureAsBuildFailure. If true (false is the default), any test failure will set the build state to Failed (vs. Partially Succeeded). Nice write-up here.

You might take the approach of creating two separate builds: one that contains all your tests and one containing just mission critical tests. Set TreatTestFailureAsBuildFailure to true for that one and any test failure will fail the build. Not precisely what you want but close. It may also be beneficial or helpful to check the TestSuccess output parameter.

Q. Can I move a Work Item from one team project to another (prefer not to copy...delete)?

A. Unfortunately, no. One can use the TFS Migration Tool but it's a bit heavy. We typically copy to the destination team project and then Close the source work item. For one client, we even developed a desktop triage application to programmatically copy and then delete defects and task requests between team projects. The client wanted to triage out of one team project and then distribute the work item to the correct team [project].

Thursday, June 04, 2009

Rollback a Ooops in TFS with TFPT Rollback

Rhut roe, Raggie. You just checked in a merge operation affecting 100's of files in TFS against the wrong branch. Ooops. Well, you can simply roll it back, right? Select the folder in Source Control Explorer and...hey, where's the Rollback?
Rollback isn't supported in TFS natively. However, it is supported within the Power Tools leveraging the command-line TFPT.exe utility. It's fairly straightforward to revert back to a previous version--with one caveot.
First, download and install the Team Foundation Power Tools 2008 on your workstation. Before proceeding, let's create a workspace dedicated to the rollback. To "true up" the workspace, the rollback operation will peform a Get Latest for every file in your current workspace. This can consume hours (and many GB) with a broad workspace mapping. To work around this, I create a temporary workspace targeted at just the area of source I need to roll back. So let's drill down on our scenario...
I'm working on Program.cs and I accidentally check in a change I shouldn't have. Oops.



Let's create a workspace mapped just to the folder housing Program.cs so we avoid a massive, entire workspace "Get" during the rollback operation.

Afterwards, select that workspace and perform a Get Latest (just to establish the file system directory). Open up a Visual Studio 2008 command prompt and browse to the workspace on the file system.
To perform a rollback, you can target a changeset or a filespec. I prefer the specificity of the changeset but whatever works for you. You also have flexibility with merge and recursive behavior. Here's the full write-up on MSDN for Rollback. Alternatively, just type in a

TFPT rollback /?



Executing the TFPT rollback command (with the /changeset option in this example), will earn you a prompt to get the latest. Go ahead and click Yes.



Important to note here with the changeset option: you want to identify the changeset one prior to the version you wish to rollback to. So, if I want to rollback to changetset 227, I want to use changeset 228 in the TFPT operation.

Next, you'll be presented with all the assets (files) in that folder involved in that particular changeset (228 in this case). We only want to roll back Program.cs so we'll only select that file. If you Ctrl-A and uncheck one box, it will uncheck them all. Click Rollback.

Next, you'll receive feedback at the command line about the operation. But wait, you're not finished! Rollback is a local operation. You still need to check in your change. This is a great "safety" if you messed up the rollback itself. Just Undo Pending Changes.
Ok, so we're ready to check in our changes.

Looking at View History once more, note we actually have a third version and changeset now: 229. But, we've indeed returned to the original (the first, changeset 227) version of the source.



Being back to square one never felt so good...

Wednesday, June 03, 2009

Installing TFS/VSTS 2010 Beta 1

I finally found some time to get rolling on VSTS/TFS 2010 and wanted to share how I kitted out my environment. Somewhat related, fantastic overview on where to start.
  1. Started with my Windows 2008 Server VPC
  2. Installed and configured IIS 7
  3. Downloaded and installed the SQL Server 2008 180-day Trial
  4. Configured SQL Server 2008 and SSRS, SSAS
  5. Turned off IE Enhanced Security for Administrators
  6. Under Win7 Beta1 (my host OS), I have a jerky mouse on the VPC. Unfortunately, the Change settings button under the Troubleshoot tab of my display driver is disabled under 64-bit :( Otherwise, I would enable the hardware acceleration recommendation. It's slightly better under full-screen.
  7. Downloaded and installed Windows SharePoint Services (WSS) v3.0.
  8. Downloaded and installed TFS 2010 Beta 1 following the instructions to the letter.
  9. Downloaded and installed VSTS 2010 Beta 1.
Happy exploring and learning!

Tuesday, June 02, 2009

Troubleshooting the TFS Data Warehouse

Occasionally, I encounter issues with the TFS data warehouse failing to refresh. Sometimes, it's as simple as the VS TFS Task Scheduler service isn't started but other times, it's more complicated. Here's a helpful troubleshooting document up on MSDN for troubleshooting the SQL Server TFSWarehouse relational table / Operational Data Store (ODS). If you're expereincing issues with Analysis Services (SSAS) and/or the cubes, reference this one.

Microsoft BizValue Series

Thanks to everyone attending my firm's monthly Microsoft BizValue Series. In case you missed it, I've presented recently on the Microsoft Business Intelligence (MSBI) stack, Microsoft Online Services / BPOS and Team Foundation Server (TFS).

We meet in our offices downtown (Columbus, OH) on the 2nd Wednesday of the month. Next week (June 10th), I'll be delivering a talk on leveraging TFS for agile software development efforts. I'll deliver a similar presentation in our Charlotte, NC offices the following day (June 11th).

You can learn more and register here and here.