Paul Hacker .Net, TFS, Etc…

October 11, 2015

Moved the blog

Filed under: Team System — phacker @ 10:05 pm

I have moved my blog to a new URL. Please visit


October 7, 2015

DogFood Conference RM 2015 talk

Filed under: DevOps — phacker @ 11:12 pm

I would like to thank everyone who came to my talk on RM 2015 today. It was great to see such a large turnout.

Here is a link to the PowerShell scripts I used.

The first one is ControlHyperVVM.ps1 and it is what I used to spin up and down the Hyper V vm I was using to deploy to. The second one was the CreateAppPool_Site.ps1and it creates the appool and website I deployed code for. It does a check to see if they exist and if not creates them. The reason I use this over the build in is that it’s more robust and does so If Then control flow that RM does not do right now.

Thanks again everyone.


September 15, 2015

Release Management 2015 and TFS Build 2015 Setup

Filed under: Team System — phacker @ 1:33 am

If you have not checked out the new build features in TFS 2015 then you really need to look into it. I have been using it now for a couple months and I must say its really nice to work with and so much better than Windows Workflow. But that’s for another post. here I want to explain the process for setting up and deploying with Release Management 2015 from TFS Build 2015. Currently there is no build task built into TFS that allows you to deploy with RM so I am using the task that Daniel Mann created.

I am going on the assumption you have setup a build pool and agent and are ready to run a build, or already have a build. Also be aware that the RM client needs to be installed on the build server for the task to work correctly.

First thing we need to do is to download the TFS Build Extensions Command Line Utility and install it. The documentation on the site works well so just follow it.  If you run the command npm install -g tfx-cli and you get an error “npm is not recognized…” then you need need to download and run the Node.js msi file. Now rerun the command to install the tfx-cli. Once you have that installed, you need to download and extract the InCycle Build Tasks.

Once you have the completed the install run the following command to verify the install worked – tfx help This should present you with the command options.

You need to be in the top level Agent Pool Administrators group to manipulate tasks See here. Follow the steps to get the user added to the group. I also had to do one other thing that was not documented anywhere. I needed to set IIS to use basic authentication. Open the Server Manager and select the Manage > Add Roles and Features


When the dialog launches, go through until you get to the Roles screen. Now locate the Web Server (IIS) (Installed). Expand the section , locate the Security (Installed) and expand it. Check the Basic Authentication checkbox.


Click next

Click Next again and then click Install. Once complete close the dialog window.

Now you need to set the tfs virtual directory to use basic authentication. To do so open the IIS Manager and expand the Team Foundation Server site. Click on the tfs virtual directory and then select the center window to Features View (tabs at bottom of window). Locate the IIS section and double click on the  Authentication item.


Now select the Basic Authentication Item. On the right side of the screen select the Enable link.


Now that we have that all set we need to login and upload the Incycle Build Task “RM Agent Release” to do so run the login command.

Open a command prompt and run tfx login –authType basic (make sure its lower case “basic”) – You need to use the authtype option if you are working with an on-premises TFS environment. Enter in the tfs collection you will be using, then your username and password.


Now that you are logged in, you need to upload the “RM Agent Release” task. In a command window enter tfx build tasks upload –taskpath <path to RM Agent Release directory>


Verify the task has been uploaded by running the tfx build tasks list command.


Scroll down the list until you see the following entry.


I am using the Tailspin Toys project so I have something to build. Now in reality I would have configured RM 2015 to do a complete deployment, but for this post I just want to show you how to fire off RM from TFS 2015 Build.

Now its time to create a build. Launch the TFS web portal and navigate to your project’s home screen.  Now click on the Build link

Once on the Build screen, click the green plus sign to create a new build definition. Select the Visual Studio template. and click OK. If you do not have a solution to build, just select the Empty definition.


Now you need to add a build step. Select the Add build step… option.

The task is under the Deploy section. Select the Start Agent-Based Release. Click Add and then close the dialog window.


Set up the build by selecting a solution to build and Save the build.


Now queue a new build. Watch the console as it runs and wait for RM to kick off.

October 13, 2014

My Atlanta Code Camp talk resources

Filed under: Team System — phacker @ 5:42 am

I want to thank everyone that came out to my talk on ALM with TFS and VS 2013. Here are some resources that we talked about.

TFS Certification Jumpstarts – Prep for exams
70-496 –
70-497 –
70-498 –


Slide Deck
Lap around ALM 2013


Thanks again

April 3, 2014

TF259641 Lab environement setup error

Filed under: Team System — phacker @ 10:44 pm

I recently was setting up Lab Management in 2013 TFS/VS. I ran into this error when preparing the vm for the environment. TF259641: To use the environment, you must install a compatible test agent in all machines of the environment.

I did what was suggested and reinstalled the test agents and I kept getting the same error. I searched around and found various answers, but nothing seemed to be accepted as a real good answer. I finally ran across this post and I read through it and I decided to try it. It is talking to an earlier version, but I tried it.

This is a blurb below from the answer that is found here.

This is talking about a server with multiple nics, but I had a single nic. Soon as I applied the fix, it worked perfectly.

Start Fix===================================================================

Stop the controller service. To do this, run the following command at a command prompt:

  1. net stop vsttcontroller
  2. In Notepad, open the QTController.exe.config file. This file is located in the installation folder of the controller.
  3. In the QTController.exe.config file, add an entry for the BindTo property of the application settings (<appSettings>). Specify the IP address of the network adapter that you want to bind the controller to. For example, the code may resemble the following:
        <add key="LogSizeLimitInMegs" value="20" />
        <add key="AgentSyncTimeoutInSeconds" value="120" />
        <add key="ControllerServicePort" value="6901" />
        <add key="ControllerUsersGroup" value="TeamTestControllerUsers" />
        <add key="ControllerAdminsGroup" value="TeamTestControllerAdmins" />
        <add key="CreateTraceListener" value="no" />
        <add key="BindTo" value="<YOUR IP ADDRESS>" />

    Note The BindTo property must be set for each process that is running on a computer that has more than one network adapter.

  4. Save the QTController.exe.config file.
  5. Start the controller service. To do this, run the following command at a command prompt:
    net start vsttcontroller
    End Fix ==============================================================================================================

February 19, 2014

Conferences I am speaking at

Filed under: Team System — phacker @ 2:28 pm

One the things I enjoy is to speak to fellow geek peers at conferences. Lately I have been on a run. In November I spoke in St. Louis at their Day of Dot Net. It was a blast. Now I am off on a few more in the upcoming couple of months.

First up I am going to be in Orlando at the Orlando Code Camp on Saturday March 22nd 2014. I have two sessions. One on the new ALM features in TFS and Visual Studio 2013 and the other is a 100 level talk on Coded UI. Here is a link to my sessions.

The following Saturday the 29th, I am going to be speaking in Mobile Alabama at the Alabama Day of Dot Net. I am doing the New ALM features in TFS/VS 2013 and one on the new Load Test Service Microsoft is offering. Here is a link to my sessions.

Then I am off to Kansas City for their Developer Conference on Saturday May 17th. I will be doing the same talks I have scheduled in Mobile. Here is a link to those sessions.

So I am up for more travel than normal, but I expect it to be a great time. If you are in the areas of these talks and are available to attend it would be great to see you out there. You should feel free to stop and say hello if you like.


October 21, 2013

Change the Work Item Limit in the TFS 2013 Sprint Backlog

Filed under: Team System — phacker @ 8:04 pm

I recently came across a situation where i need to increase the work item limit in the TFS 2013 Web Access sprint backlog. If you go over the limit you will get a warning message when you access the sprint backlog and the task board will not function correctly. The default limit is 500 work items.

In order to fix it you need to do the following:

Open an elevated command prompt and navigate to the Visual Studio 2013 install. On my machine its at C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE

in there you will find the witadmin executable. That is what we need to run. so in the command prompt, run this command:

witadmin exportprocessconfig /collection:CollectionURL /p:ProjectName /f:”DirectoryPath/ProcessConfiguration.xml”

Open the file you just downloaded and find the following

<TaskBacklog category=”Microsoft.TaskCategory” pluralName=”Tasks”

Add the following values singularName=”Task” workItemCountLimit=”800″ so the line looks like this:

<TaskBacklog category=”Microsoft.TaskCategory” pluralName=”Tasks” singularName=”Task” workItemCountLimit=”300″ >

Use any value that you need to increase the limit to. In this example its 300

Now you just need to import it back to TFS.

witadmin importprocessconfig /collection:CollectionURL /p:ProjectName /f:”DirectoryPath/ProcessConfiguration.xml”

hope it helps


October 17, 2013

VS 2013 RTM and TFS 2013 RTM available

Filed under: Team System — phacker @ 11:33 am

MSDN subscribers can go and download VS 2013 and TFS 2013 RTM from their MSDN account.

September 17, 2013

TFS 2012 Build custom versioning build template

Filed under: Team System — phacker @ 7:08 pm

There are quite a few posts out there for creating a custom workflow that increments the version number so I am not walking through all the steps to do it, but rather why did it. I found the following posts as excellent resources to start with:

I started with Bryan’s blog and went from there. I had some requirements that I had to follow which is why I created a new one.

The requirements were:

1. Must write the version number to a file and not check in stamped assemblyinfo files

2. There must be a way to set a revision increment. Basically they needed to set a value to increase the revision number by. There strategy was even revision number for patches and odd for full installs.

3. I had to set an Environment variable with the new version number

The following is what I came up with for the Execute method:

protected override void Execute(CodeActivityContext context)


var sourcesDirectory = context.GetValue(SourcesDirectory);

Int32 major = context.GetValue(Major);

Int32 minor = context.GetValue(Minor);

Int32 build = context.GetValue(Build);

Int32 revision = context.GetValue(Revision);

Int32 revisionIncrement = context.GetValue(RevisionIncremnent);

string versionFileLocation = context.GetValue(VersionFileLocation);

var assemblyInfoFileMask = context.GetValue(AssemblyInfoFileMask);

var oldValue = “”;

//if there is no file then create it and add a default version number that uses the revision number we set in the build

//otherwise just get the current value

if (!File.Exists(versionFileLocation))


oldValue = “0.0.0.” + revision.ToString();





oldValue = File.ReadAllText(versionFileLocation);



// since all we need is the revision number lets get it.

var revisionNumber = oldValue.Split(‘.’);

int newRevision = int.Parse(revisionNumber[3].ToString()) + revisionIncrement;

//find all files that match the assembly mask we set

foreach (var file in Directory.EnumerateFiles(sourcesDirectory, assemblyInfoFileMask, SearchOption.AllDirectories))


string text = File.ReadAllText(file);

var newVersion = new Version(major, minor, build, newRevision );

// we want to find ‘AssemblyVersion(“”)’ etc

foreach (var attribute in new[] { “AssemblyVersion”, “AssemblyFileVersion” })


var regex = new Regex(attribute + @”\(“”\d+\.\d+\.\d+\.\d+””\)”);

var match = regex.Match(text);

if (match.Success) text = regex.Replace(text, attribute + “(\”” + newVersion + “\”)”);



System.Environment.SetEnvironmentVariable(“VersionNumber”, newVersion.ToString(), EnvironmentVariableTarget.User);

//update the version text file with new version number

File.WriteAllText(versionFileLocation, newVersion.ToString());



The code is pretty similar to what you see in the blogs i referenced.

I added the following arguments to the xaml file: RevisionIncrement and VersionFileLocation

RevisionIncrement – The value you want to increase the revision number by in each build

VersionFileLocation  – The path to the file were we will track the version.

When I use the template in a build definition it looks like so:


I also ran into a gotcha that the posts do not talk about.

The issue/solution are posted here.

Basically you have to update the xaml code as outlined in the post. Now you will need to add the line of code every time that you update the xaml workflow as every change you make to the xaml wipes out that line.

Hope this helps anyone looking to create a custom build workflow.


May 23, 2011

Filed under: Team System — phacker @ 12:47 pm

A member of our user group, IndyTFS, created som browser definitions for VS Load testing. You can check these out here.
The definitions include IE9, IE9 compatibility, IE Mobile (WP7), and a few versions of Mobile Safari.


Older Posts »

Blog at