Introduction

As a TFS user you generate data during your projects. Depending on the process you follow and the artifacts you store in TFS this can be a small or a large amount.

In any case, the data you gather, is stored and will be stored in TFS for the rest of your days.

During my daily work I see a lot of people using TFS but there are only a few companies that use the TFS reporting functionality to the fullest. Probably this is because people are not familiar with the tooling, the data model and the data to create useful reports.

In this blog series I will talk about the different aspects of TFS reporting. I talked about this subject on the Dutch Techdays. This session can be found here. (session is in Dutch).

Using Custom Reports in TFS: Part 1 – Introduction in TFS Data

To create good reports, you need to understand how TFS stores and processes the data in the first place. In the picture below the different data stores are described.
image

The TFS Configuration database (Tfs_Configuration) contains all information that is needed to keep TFS up and running. It contains information about the different project collections, server security, events, notifications, jobs etc.

The TFS Configuration database registers every Team Project Collection. The Team Project Collection database is the operational store (Tfs_DefaultCollection). All data that you gather in all of your Team Projects is written to this database. Work Items, Version Control, Builds, Project Security etc.

All Collection Databases consolidate to the TFS Warehouse (Tfs_Warehouse ) database. Not all data in the operational store is send to the warehouse. For work items you can influence which data is send to the warehouse by setting the reportable attribute on work item fields (more information about the different attributes you can find here). For example if you add a field to a work item you can choose how the field is published to the warehouse (none, dimension, measure or detail). Most of the fields you add will be dimension fields (category, team name, priority etc.).

The TFS warehouse is a relational database. Once every two hours ( interval can be changed see http://msdn.microsoft.com/en-us/library/ms244694.aspx) the TFS Cube (Tfs_Analysis) is updated with new information. Only dimensions and measures are send to the cube.

Where to look for data for my reports

The TFS Warehouse and TFS Cube are the only 2 sources that you use for reporting. In some exceptional cases it can be handy to query the Collection database as well but this is not recommended or supported.

The cube contains all historical data already processed. For example a Burndown graph or another historical graph is typically drawn from the TFS Cube.

For the reports that I built I used the TFS Warehouse most of the times. First of all because you can use SQL as language (instead of MDX on the cube) and the refresh rate is almost instant (instead of every 2 hours)

What do I need to do to get some data?

This is sometimes an interesting problem. If you only use Version Control, the data for custom reports is not very rich. To give you an idea I describe 2 Out of the Box reports and what you need in order to fill them.

clip_image004

Sprint Burndown

  • Create Sprint Work Item with start and end date
  • Create Product Backlog Items
  • Create Tasks
  • Assign PBI + tasks to sprint
  • Set remaining work on tasks
  • Update remaining work + status every day or more !

clip_image006

Velocity

  • Create Product Backlog Items
  • Set StoryPoints
  • Close ! PBI’s
  • Assign to sprint

Only data that is managed will give you valuable information!

In my next post, I will describe the different tools to create TFS Reports

As I described in my previous posts, my company has been working on a WP7 app that allows you to upload attachments directly to your TFS server using the TFS Odata Service.

Read about this here:

In this post I like to walk you through how to configure and use the app.

Download and Configure

When you download the app from the marketplace (Download App from marketplace) and start up the first screen shows your favorites. There are no favorites because you first have to configure the app.

Press the (…) button on the bottom of the screen to show the settings screen.

image

Fill in your TFS credentials, the ProjectCollection you are working on and the url of the TFS OData Service that you are using. (read here how to make this available). Save the settings when you are done. If the url cannot be found or accessed, the settings will not be saved.

image

Finding Work Items and Attaching Pictures

Once you are successfully connected to a TFS server, your app shows a list of projects that are available on your server.

image

When you select a project, all queries within this project will show up. Treeview queries or Direct Link queries are ignored. Select a query to obtain the results. TFS Attacher_2-9-2012_11.1.7.847 image

Select a Work Item to see the details. Swipe to see the attachments. Select the camera button or storage button to add an attachment.

imageimage

When you took a picture or selected one from storage. You can modify the name and comment of the picture. Press the send button to upload the picture to TFS.

The TFS OData service cannot accept attachments larger than 64 KB. The TFS Attacher will therefore resize and compress the picture so  that it is smaller than 64 KB.

The upload is asynchronous. It first gives a message that the picture is send. After that you will receive a message that the upload succeeded.

imageTFS Attacher_2-9-2012_11.35.40.57TFS Attacher_2-9-2012_11.35.47.518

Organizing and Quick Access

To make it easier to access your favorite queries or work items we built in 2 features. Favorites and Work Item Search.

Work Item Search

On the main screen swipe until you find the “Search for Work Items” Screen. You can type a work item id and the work item is found. Press the work item to access it.

image

Favorites

On queries and work item details the “Star Symbol” appears. If you click this symbol, the query or work item is added on your favorites screen. You can now directly access it. You can add queries and work items from different projects.

imageimage

The first screen will show your favorites !

image

Have fun with the TFS Attacher !

This blog post describes how to install and configure the OData TFS Service on your corporate TFS Server. I made this post because the TFS OData documentation does not really cover this topic very well. It covers the installation on Azure and on CodePlex.

A little background

My company Delta-N, built a nice Windows Phone application. The TFS Attacher. This application allows you to attach images to an existing work item on your TFS Server. For example when you draw pictures on a whiteboard during a stand up meeting, you can take a picture of the whiteboard and directly attach to the work item.

OData Service

The TFS Attacher works with the TFS OData Service. This service provides an elegant way to access and query TFS. Also some modify actions are enabled with this service. For example adding attachments to a work item.

You can find all about the OData Service on the blog of Brian Keller. You can download also from the Microsoft site.

Installing the Service

When you download the service and extract the bits, you’ll notice that it is not really an installable application, but more a set of source, docs and assemblies.

image

When I read the StartHere.htm or the word document inside the doc folder I got a little confused. I talked about azure and the examples were based on the CodePlex TFS.

I wanted to install the OData service on my TFS production Server. The document states that the Azure Tools for Visual Studio are needed to run the service. I do not want to pollute my production server with development tools.

So I tried some things from the documentation and tested some things and found a good work around to use the service on our corporate TFS.

Here are the steps I performed

Set up my Development environment

As I mentioned earlier, the OData download contains source code. The first thing I did was setting up my Development machine so that the OData service could be built and run. I followed the instructions that were in the document.

Most important thing is to run the setup.cmd. This install all the SDK’s and prerequisites. After installation open the ODataTFS.sln on your local computer and build solution.

Prepare Production Server

Now it’s time to prepare your production server to host the OData Service. It is not necessary that you host the OData Service on the TFS Production server. It can be any other server that can access your TFS Server but for now I chose to install it on the TFS Server.

First I made sure that my IIS had the necessary prerequisites.

  • Microsoft Visual Studio Team Explorer 2010
  • Microsoft .NET Framework 4
  • Internet Information Services 7, with the following features:
      • ASP.NET

        image

      • WCF HTTP Activation Feature Enabled

        image

I created a new directory called ODataTFS and created a new website pointing to this directory. Note that a new application pool is created.

image

  • Grant full access permissions to the IIS_ISUR user to the %programdata%\Microsoft\Team Foundation local folder.

    image

  • Grant read access permissions to the IIS_ISUR user to the ODataTFS folder
  • Open the advanced settings of the application pool and set the .Net framework version to v4.0

    image

  • Navigate to Authentication

    image

  • Disable all authentication methods
  • Enable Anonymous authentication
  • Start your application pool and website

Create deployment

Now it was time to create a deployable package which we can run on our production server. Surely, the nicest way to do this is to create an automated build on TFS to build your solution. However, in this case I will describe the easiest way to achieve this.

In the first step I opened the ODataTFS.sln and build it. Now I use the Publish Website option to create a deployable website.

image

image

The output in the directory is the set that you want to deploy. However, if you deploy this solution you will get an error message stating that some dll’s cannot be found.

This error is related to the fact that the Azure SDK is not and will not be installed on our production server. Luckily we can work around this.

Navigate to C:\Program Files\Windows Azure SDK\v1.5\bin\runtimes\base and copy the following files to the bin directory in your publish folder.

  • Microsoft.WindowsAzure.ServiceRuntime.dll
  • msshrtmi.dll (in subdir x86 or x64)

Now you need to make some modifications in the web.config. Again, the nice way is to do it in the automated build using Config Transformations but for now manually will do.

Remove the following section

   1: <system.diagnostics>

   2:   <trace>

   3:     <listeners>

   4:       <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">

   5:         <filter type="" />

   6:       </add>

   7:     </listeners>

   8:   </trace>

   9: </system.diagnostics>

set compilation debug to false

   1: <compilation debug="true" targetFramework="4.0" />

Change this setting to your own TFS url. (e.g. https://tfs.mycompany.com/tfs)

   1: <!-- TFS CODEPLEX SETTINGS -->

   2: <add key="ODataTFS.TfsServer" value="https://tfs.mycompany.com/tfs" />

NOTE: Make sure you run the OData service and your tfs service under https.

Deploy and Test OData Service

Copy the contents of your publish directory to your production server in the directory that you created there. Make sure the website is started.

Navigate to the website. If it is set up correctly, the page will display the following:

image

Now edit the url so you can access the OData Service. For example to retrieve projects you type.

{odataurl}/{CollectionName}/Projects –> https://odatatfs.mycompany.com/DefaultCollection/Projects

You will be asked for credentials. These are TFS credentials. If it is set up correctly, a list of projects will appear.

More examples are on the start page that shows when you access the url of your service.

Summary and Links

Posted by: renevo | February 7, 2012

Delta-N launches TFS Attacher for Windows Phone 7

Last week Delta-N, the company I work for, launched the TFS Attacher for Windows Phone 7 on the marketplace.

This is great news. We built this application with the following scenario in mind,

During Sprint planning meetings or just 1 on 1 meetings we work our way through Product Backlog Items, Requirements or Tasks. What happens very often is that we use the whiteboard to draw some diagrams to clarify our requirements or design.

We often take a picture of our drawings and then store this in SharePoint or attach it to a work item in TFS. This is quite some work.

The TFS Attacher for WP 7 allows you to do this directly from your phone. You find the appropriate work item, take a picture and it is automatically saved as an attachment for this work Item.

You can find the TFS Attacher in the WP 7 Marketplace. More information can be found on the Delta-N website.

08f7d614-ebbe-43a6-9662-a5f92b465ed192f793e3-f9e6-48a4-b39d-0b6faae1638275176a2c-8b12-40b5-83ab-0f13be13bef6603992de-9829-4482-9881-4c71c5a4c5bd

The TFS attacher uses the TFS OData service. More information about this service can be found here. http://blogs.msdn.com/b/briankel/archive/2011/10/26/odata-service-for-team-foundation-server-2010-v1.aspx

Have fun with it !

Posted by: renevo | January 25, 2012

Where to store my documents in TFS

As a Team Foundation Server user you have several possibilities to store your documents. Multiple options are always nice but it is also confusing if you do not exactly know what to do.

As a result of this, I often hear the same question. Where to store my documents ?

Let me start with listing the different possibilities:

  • Store your documents as an attachment of a Work Item
  • Store your documents on the SharePoint portal (or documents folder in Team Explorer)
  • Store your documents in Source Control

Store your documents as an attachment of a Work Item

image

You can store attachments in work item. This is convenient because you have all the extra information (such as screen dumps, xml schemas, diagrams etc.) together with the bug or task.

On the other hand it is more difficult to find attachments.

Conclusion:

Store attachments in a work item if the file is only related to the work item and not to other work items or requirements.

A screen dump of an error is a good example of an attachment, but a diagram for some functional design can better be stored somewhere else.

Store your documents on the SharePoint portal (or documents folder in Team Explorer)

image

The most obvious location is to store the documents or files on the related SharePoint Portal. This is convenient because developers (or other Visual Studio users) can access these files by the Team Explorer whilst Non VS users access the files via the browser.

My opinion is that you should store all project related documents such has Designs, Planning, Drawings, Prototypes, Meeting minutes etc. on the project portal.

But what when you ship your product or end your project?

 

Store your documents in Source Control

image

Source Control is your primary source for all your code and essentially your product that you ship.

Documentation and even design is a very important part of your release and is in most cases something you like to ship.

All documents that should be part of your release (like End User Documentation and I n some cases Functional and Technical Design) is suitable for storage in Source Control. Everything is kept together.

When you start working on a new version you create a branch in Source Control, and all documentation is also branched.

Conclusion

Use attachments of Work Items only if it is relevant for the work item itself. During the project use the project portal to create, edit and share documents. When the project is finished, grab all relevant documents from the portal and store them, along with your code, in Source Control to guarantee a complete package for release !

Good luck !

imageFirst of all happy new year to everybody! I did not blog for a while because of some personal circumstances. But now I will try to make some regular posts again.

Because of these personal circumstances I cancelled my session “Hidden Gems in TFS” on the Dutch Techdays 2012. I was lined up for a session but I can not make it Sad smile.

In november my (Dutch) article How to deal with generic libraries was published on the Dot Net Magazine Site. This is the site of the magazine that is published by Microsoft 4 times per year.

My new year started with the good news that my article is not only published online, it is also published offline in the magazine.

For the people who have a subscription to this free magazine, you can find my article on page 57 of the Dutch .Net magazine of january 2012.

Happy Reading!

In this series of blog posts I like to highlight some features of TFS/Visual Studio that people seem to overlook. In my day to day job I often see that people don’t know about certain feature that are available in Team Foundation Server, Visual Studio or some of the Powertools.

Some features are available as a Powertool. These can be downloaded from here

Earlier Posts

In this part……

Searching and Finding Work Items in Team Foundation Server

Searching work items is something you need to do on regular bases. In Visual Studio Team Explorer you can look for work items by ID. Most of the times it is more useful to search for work items by a text in the title or description.

In order to do this in Visual Studio you should make a Work Item Query and use the “Contains” field with a certain text.

clip_image002

Luckily in the TFS powertools there is the full work item search. When you have this powertool installed you can search for text in multiple fields at the same time.

clip_image004

The weird part is that in the Web Access client this functionality was already there for a long time, only it is not really obvious that this feature is present (almost hidden in the UI (in my opinion))

When you open the web Access Client (normally http://servername:8080/tfs/web) you can search for work item ID in the top right corner.

clip_image006

This is somewhat confusing because on the left side (almost greyed out) you can search for work items.

clip_image008

When you type the search term in here, it will query all work items in your selected Team Project.

clip_image010

Enjoy!

In the last weeks I wrote a migration tool to migrate test cases from Rally to Team Foundation Server. This tool is deployed to a server and runs as a Windows Service.

After I made a small update to this tool suddenly my tool stopped working.

My log file gave me the following error:

Error in Querying Work Item System.NullReferenceException: Object reference not set to an instance of an object

 

This amazed me, because it has worked before and the code that I used to create the WorkItemStore has not changed.

   1: TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(TfsServerURI), nc);

   2:  

   3: _wis = tfs.GetService(typeof(WorkItemStore)) as WorkItemStore;

I searched a long time and it drove me nuts. The code did not change but it did not work. Then I found a hint in a forum. There is another way of creating the WorkItemStore.

   1: TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(TfsServerURI), nc);

   2:  

   3: _wis = new WorkItemStore(tfs);

When I deployed this, it still did not work, but at least the error message was helpful.

System.TypeInitializationException: The type initializer for ‘Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore’ threw an exception. —> System.IO.FileLoadException: Mixed mode assembly is built against version ‘v2.0.50727′ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

 

This helped me a lot. I changed code and referenced a new assembly. An assembly for the Test Manager API. This is a .Net 4.0 assembly.

The other assemblies are still based on the .Net 2.0 framework. Mixed mode is something that is not supported out of the box. You need to change some configuration in the windows service to support this (same goes for Web)

Add this to your app.config or web.config

   1: <?xml version="1.0"?>

   2: <configuration>

   3:     <startup useLegacyV2RuntimeActivationPolicy="true">

   4:         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

   5:     </startup>

   6: </configuration>

The attribute useLegacyV2RuntimeActivationPolicy="true" is the keyword!

When I deployed my service it worked !!

In this series of blog posts I like to highlight some features of TFS/Visual Studio that people seem to overlook. In my day to day job I often see that people don’t know about certain feature that are available in Team Foundation Server, Visual Studio or some of the Powertools.

Some features are available as a Powertool. These can be downloaded from here

Earlier Posts

In this part…….

Managing workspaces in TFS with Workspace templates

Another powertool feature and yet again widely unused by customers. Workspace templates. Often developers have their own way of organizing folders and files. Some people create different structures than others.

When working is a development team in 1 project, it is very useful to have the same structure on your local disk. In this manner you can use relative paths and make configuration a bit easier.

TFS provides you with the concept of workspace. In short, a workspace is a mapping of one or more local folder(s) to one or more source control folder(s).

workspace

Because you can flexibly create workspaces developers have a lot of freedom in structuring their projects.

With workspace templates you can provide your developers with a standard way of organizing their workspace. Your whole team uses the same structure and enjoys all the benefits.

How does this look?:

  • In Team Explorer right click on Team Members and choose Team Settings. If team members is not in your explorer install the powertools first
    image
  • On the general Tab create a new workspace template. Create mappings or import from an existing workspace. Watch the z:\{root} which indicates that people can still choose their root folder. Inside the folder it will contain the structure as you define in the template

    image 

  • Save the template
  • As a team member you can now easily right click Team Members and choose Create Workspace

    image

  • Provide a root path on your own machine and voila. Structure is created automatically

    image

    image

Have fun !

In this series of blog posts I like to highlight some features of TFS/Visual Studio that people seem to overlook. In my day to day job I often see that people don’t know about certain feature that are available in Team Foundation Server, Visual Studio or some of the Powertools.

Some features are available as a Powertool. These can be downloaded from here

Earlier Posts

In this part…….

Handling alerts and notifications

I often get questions about alerts. For example.

  • I want to have an email when someone assigns a bug to me
  • I want to have an email when person xxx checks in code
  • I want to call a service when the build completes
  • I want a notification when the state of this work item changes.
  • etc.

Team Foundation Server makes intensive use of events. Many actions trigger an event on the Team Foundation Server and the good thing about this is that you can subscribe to these events.

Examples of events are:

  • Work Item Changed
  • CheckIn event
  • Build Completed event

When subscribed to an event you can do two things. You either send an email or you call a SOAP webservice. Especially calling a Webservice gives you a ton of possibilities to extend Team Foundation Server to your own needs. You can find all about this in this article (VS 2008 but still applies).

You can subscribe to events in different manners. You can use the commandline tool BISSUBSCRIBE.

You can also use the default project alert dialog. This defines some default scenarios on which you can subscribe to receive an email.

image

image

However, the most powerful way to subscribe and have optimal control is to use the Alerts Explorer that is part of the powertools.

On Collection level click right and choose Alerts Explorer.
image

In the alerts explorer, you can easily set up alerts based on a query.

Click New Alert choose your category and choose OK
image

After that you can further modify you filters and delivery methods.

image

Html and Plaintext send an email message in the selected format. SOAP calls a webservice. This webservice has to implement a specific interface. This is described here

Have fun !

Older Posts »

Categories

Follow

Get every new post delivered to your Inbox.