Mathias Olausson [MVP]

Archive for the ‘Uncategorized’ Category

Getting started with Microsoft Lab Management

without comments

The last couple of weeks I’ve gotten a number of questions on how to set up Microsoft Lab Management. The process is not trivial but the references below should get you started:

If you want to get started with Microsoft Lab Management then you can get a number of good starter videos here.

I can also recommend looking at the MSDN documentation on how to set to Lab Management, lots of good guidance and recommendations there.

I suggest working with someone with good knowledge of Windows Server and Hyper-V as well as the System Center Virtual Machine Manager. For a developer such as myself it can be quite overwhelming with all options in these products. It’s one thing to get a demo environment up and running but for a production environment you really should build the foundation right first. So team up with someone knowledgeable in the IT side and combine that with the test and development skills is my recommendation.

Written by Mathias Olausson

October 31st, 2010 at 4:12 am

Posted in Uncategorized

Browse items in TFS Version Control programmatically, reposted

without comments

I got a comment a while back that some articles on my old blog has broken links so I’m fixing that by reposting the updated articles here. This one is about using the TFS API to open a browser dialog from TFS 2008. The code still works with 2010 but there might be a better way to do that now but for now this is a working solution.

Ever wanted to use the TFS API to pull up a dialog to let a user browse the version control repository and select a file or a folder? Unfortunately it turns out there is no function to do so. Or atleast, no obvious way…

With pointers from Philip Kelley at Microsoft I learnt that inside the Microsoft.TeamFoundation.VersionControl.Controls assembly there’s a private class called DialogChooseItem that displays the following dialog:


In order to use that dialog we’ll have to invoke by using .NET reflection. The constructor can take either just the TFS to connect to (start at the root of the version control tree) or the folder and file to navigate to when the dialog is shown.

The key code to invoke the dialog is the following (based on Visual Studio 2008 SP1 and TFS 2008 SP1):

VersionControlServer versionControlServer = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
Assembly controlsAssembly = Assembly.GetAssembly(typeof(Microsoft.TeamFoundation.VersionControl.Controls.ControlAddItemsExclude)); 
Type vcChooseItemDialogType = controlsAssembly.GetType(“Microsoft.TeamFoundation.VersionControl.Controls.DialogChooseItem”);
ConstructorInfo ci = vcChooseItemDialogType.GetConstructor(
                   BindingFlags.Instance | BindingFlags.NonPublic,
                   new Type[] { typeof(VersionControlServer) },
_chooseItemDialog = (Form)ci.Invoke(new object[] { versionControlServer });
 this.DialogResult = _chooseItemDialog.DialogResult;

To get to the selected item access the SelectedItem property (again using .NET reflection):

_selectItemProperty = vcChooseItemDialogType.GetProperty(“SelectedItem”, BindingFlags.Instance | BindingFlags.NonPublic);
Item selectedItem = (Item)_selectItemProperty.GetValue(_chooseItemDialog, null);

That’s it. With some simple .NET reflection magic we can now use the internal item brower dialog.

The complete sample can be downloaded here: (15,63 KB)

Update: a solution for Visual Studio 2010 cam be downloaded here: (17,67 KB). 

Disclamer: the DialogChooseItem is an internal unsupported implementation. It may change at any time so if you use it your’re on your own.

Written by Mathias Olausson

October 21st, 2010 at 5:00 am

Posted in Uncategorized

Clone a Build Definition

with one comment

In the September update of the TFS Power Tools a very handy feature for managing TFS build definitions was introduced. This feature saves time and reduces the risk for errors when managing build definitions. To clone a build definition all you need to do is to right-click on the source build definition in the Team Explorer and choose “Clone Build Definition”.

After you have cloned the build definition there are some things that needs to be fixed however:

  1. Clone build definition.
  2. Disable build definition to prevent accidental triggering.
  3. Rename the build definition.
  4. Change workspace mapping to new location (if needed).
  5. Change drop location (if needed).
  6. Change the process to point to the right projects/solutions (if needed).
  7. Enable the build definition.

Screenshots below to illustrate the process:

1. Clone build definition.



2. Disable build definition to prevent accidental triggering. Rename the build definition.


3. Change workspace mapping to new location (if needed).


4. Change drop location (if needed).


5. Change the process to point to the right projects/solutions (if needed).


6. Enable the build definition.

Written by Mathias Olausson

October 21st, 2010 at 4:41 am

Posted in Uncategorized

Agil testning med Microsofts nya testverktyg

without comments

Vi på QWise kommer att i oktober köra ett kostnadsfritt frukostseminarum om de nya testverktygen från Microsoft:

Känner du som testare att utvecklare lämnar funktioner till test som har dålig kvalitet? Upplever du som utvecklare att testare klagar på småsaker och rapporterar buggar som inte går att reproducera? Kan det vara så att vi egentligen tycker om varandra men av olika anledningar har hamnat snett i vår relation?

Agil Testning

Med lanseringen av Visual Studio 2010 och Team Foundation Server 2010 släppte Microsoft en ny serie verktyg för integrerad testhantering. Med dessa verktyg kan du få bättre kontroll över testprocessen och inte minst ge möjlighet till bättre samarbete mellan testare och utvecklare!


  • Testplanering och testexekvering
  • Rik buggrapportering
  • Testautomatisering
  • Automatiska byggens roll i testarbetet
  • Uppföljning av tester
  • Miljöhantering med Microsoft Lab Manager

Plats och tid

Vi bjuder på frukost med start 8.30 för båda tillfällena.

Göteborg: tisdag 26/10, 9.00-12.00, Svenska Mässan

Stockholm: onsdag 27/10, 9.00-12.00, Microsoft, Kista


Anmäl dig till , glöm inte att specificera vilket tillfälle som avses.

Written by Mathias Olausson

September 23rd, 2010 at 4:17 pm

Posted in Uncategorized

TFS 2010 lets you rename work item type defintions

without comments

Have you ever created a work item type and later on wanted to change the name to something different? Then you know the pain this will result in… Add new type definition, migrate data from old type to new (yes, most of that done by hand since work item ids change and so on) and finally delete the old work item type. Ohhh…

Now with TFS 2010 it is possible to rename a work item type definition. Using the command-line tool witadmin.exe you can specify the renamewitd argument followed by the details about the work item type to rename:



Written by Mathias Olausson

November 1st, 2009 at 3:50 pm

Posted in Uncategorized

New blog starts here…

without comments

I’ve decided to move my old blog here. Why? Mainly because I’m lazy I think. I used to manage my blog myself. Not much work really, but still the issues of up-time, upgrades and all that good stuff. Another part of the lazy business comes from me wanting to use Word for blogging and I couldn’t get the old software to like that idea very much. So far this blogging provider seems to deliver what I need so I hope I’ll get around to writing a bit more than I have done lately.

So thanks to for providing space for yet another blog!

Written by Mathias Olausson

August 30th, 2009 at 3:05 pm

Posted in Uncategorized