Fixing reports in exported Visual Studio Online project collection

As Visual Studio Online has gone to general availability (i.e. no more free rides), a lot of people used TFSCONFIG CLOUDIMPORT command to export your TFS projects from Visual Studio Online to the on premises TFS server. That tool makes the export very smooth and actually easy process. But, that's not what we here to talk about. We're here to talk about fixing reports once you have finished the export. CloudImport command only imports TFS content and does not deal with reports at all. So, reports will have to be fixed manually.

First of all, you need to recreate the reports in the Report Server. By the way, you need to upload reports from TFS Scrum template. You can recreate reports using TFS Administrator's Toolkit or all-powerful PowerShell. Once reports are uploaded and warehouse/cube being processed, you will noticed that some of the reports do not work. If you check warehouse processing status, you will notice that an error being thrown during warehouse processing.

System.Data.SqlClient.SqlException: Cannot create compensating record. Missing historic data. Predecessor of work item(s)…

Very confusing error… Points to some kind of confusion between revisions. How can that be? How can the data get "corrupted" during the export? And, more importantly, what data got "corrupted"? To get answer to the last question, try running the following SQL statement against your project collection database:

Select *

FROM [dbo].[WorkItemsLatest] L

JOIN [dbo].[WorkItemsAre] A

ON L.[ID] = A.[ID]

    AND L.[Rev] = A.[Rev]

WHERE L.[Changed Order] <> A.[Changed Order]


If the query returns any records, then we have a problem. Most likely all of the returned records have "messed" up revisions. Potentially, that could be a lot of records. To fix the problem, Microsoft provided us with the following SQL query:


SET L.[Changed Order] = A.[Changed Order]

FROM [dbo].[WorkItemsLatest] L

JOIN [dbo].[WorkItemsAre] A

ON L.[ID] = A.[ID]

    AND L.[Rev] = A.[Rev]

WHERE L.[Changed Order] <> A.[Changed Order]



After running the script manually refresh warehouse and cube, and you should be fine. Good luck.

UPDATE: See a few more details on how we've fixed the reports after exporting TFS project collection from Visual Studio Online at

Release Management for Visual Studio custom training and more…

Over the next month, I'm planning to write a custom one day course on Release Management for Visual Studio. Here is a draft course outline:

Module 1: Introduction to Release Management for Visual Studio

  • An overview of the features of Release Management
  • How to reduce the risks and costs associated with releasing software
  • A look at the Build-Deploy-Test-Release process

Module 2: Installing and configuring Release Management for Visual Studio

  • Installing and configuring the Release Management Server and Client
  • Installing Deployment Agents
  • Configuring roles and permissions in Release Management

Module 3: Configuring Release Paths and Release Templates

  • Defining servers and environments
  • Configuring release path stages
  • Understanding release templates
  • Setting up a deployment procedure for each stage
  • Configuring a build definition to use the Release Management process template

Module 4: Release Management Execution

  • Use of Token
    • Tokens description
    • Token replacements
  • Execution of a Full Release Cycle
    • Trigger manual release
    • Approvals
    • The deployment log
    • Audit and history
  • How to Approve a Request
    • Release Management console
    • Notifications
    • Release Management Web client
    • Deferred deployment
  • How to Release from TFS
    • Configuration of a build definition to use the Release Management Default Template
    • Configuration of an Application Version to allow triggering a Release from the Build
  • Debugging a Deployment
    • Internal logic of a deployment
    • Different logs available


The course will be available for public and private training at the end of July 2014. After writing this course, I'm planning to author a more comprehensive three day DevOps course where we will cover TFS Build server, Release Management, and Application Insights from Microsoft Azure. Three day course should be available around September 2014.

If you're interested in these courses, please contact ObjectSharp training at 416-649-3690. J



Error upgrading TFS 2010 to TFS 2013

I was helping another client to upgrade TFS 2010 to TFS 2013, as I did tens and hundreds of times before, and I thought I saw it all. All possible errors, warnings… all the weird stuff. I was wrong. There is always something. Something that can go wrong. Something new to learn. Anyways, back to the upgrade. As I was saying, I was upgrading TFS 2010 to TFS 2013. It began as a fairly straightforward upgrade. You build new TFS 2013 environment, detach TFS 2010 project collection, (if you're moving from SQL Enterprise to Standard - backup up the database and remove encryption/compression), backup the database, restore the database, and finally attach TFS 2010 project collection to new TFS 2013 environment. Easy, right? Well, I forgot to mention, fixing reports, SharePoint sites, build definitions, etc. But, still, very straightforward process. Except, this time.

This time when I was attaching TFS 2010 project collection to newly built and awesome TFS 2013 environment, I got an error: "TF400744: An error occurred while executing the following script: WorkItemTrackingToDev11Beta2Custom.sql. Failed batch starts on the line 1. Statement line: 35. Script line: 35. Error: 4922 ALTER TABLE ALTER COLUMN SeqId failed because one or more objects access this column." I have never seen this error before. There wasn't much information on this error online either. So, I have tried re-running project collection process again to make sure that we have not missed anything. Got the same error again. Disappointing.

After some digging, a lot of digging actually, I still did not find anything. I knew that the problem must lie within the database. The database must got corrupted somehow. But, I couldn't put my finger on it though. So, I called Microsoft support. We dug some more. Then, some more… And, finally, we have found a problem. Apparently, project collection database was manually modified. An index was created on one of the columns (SeqID column), and that was preventing upgrade process dropping that column. That was it. That was the reason why we lost hours trying to solve the mystery of failing upgrade… So, the lesson is DO NOT make manual changes to any TFS databases. It might seem like a good and perfectly harmless idea at the time, but it's not. It never is.

Error while migrating from Visual Studio Online to an on premise TFS

As I'm sure we all know, Visual Studio Online has gone to general availability recently, which means that very soon you will have to pay to use Visual Studio Online. We all knew it was coming… and now you might have to make a decision whether you should stay in the cloud or whether you should move your TFS to your internal network. To be fair I think that, in some cases, it could be very well worth it to pay for hosting TFS in the cloud instead of hosting one internally. However, in some cases it might be cheaper for customers to host TFS internally. Those users need to move TFS content from the cloud to on premise server. Kudos to Microsoft for providing an easy to use Data Export tool (see for more info) to migrate your Visual Studio Online contents to on premise TFS server. I wish they made that tool available permanently to users, instead of just for a short time… but I'm not complaining.

Anyways, for the most part this is a fairly to use tool and it worked just fine every time I use it. But once I got the following error: "TF400711: Error occurred while executing servicing step download bacpac from azure storage for component cloudimport during cloudimport: the remote server returned an error: (403) forbidden", trying to migrate Visual Studio Online contents to on premise TFS server. In my case, this error was caused by a simple fact that my export package created in Visual Studio Online has simply expired. I forgot that the package is only valid for 10 days, and gets deleted from Microsoft servers once expired. So, simply start export process again in Visual Studio Online, get a new export package, and run TFSCONFIG CLOUDIMPORT command again using new export package.

Release Management Application Pool is down

If your Release Management application pool keeps crashing and you get the following error: Message: Object reference not set to an instance of an object.: \r\n\r\n at (Object ) … at RM.MonitoringAgent.Services.MonitorService.ProcessScheduledPromotions(), run the following command to fix the issue:

appcmd.exe set config -section:system.webServer/globalModules /[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64

Make sure that you run this command as an administrator.

It's on! At The Movies is back!

For those who have attended At The Movies (ATM) event in the past, I'm happy to announce that ATM event is back on. You know it'll be awesome, so make you register at before we run out of space in Scotibank movie theater. 

For those who have not attended At The Movies (ATM) event in the past, well, you have missed out on a lot of fun (and expert knowledge.) So, don't let that happen to you again and register for the event at You will not be disappointed. Did I mention that this is a free event?!?

To remind you how awesome ATM events are, I have added a few links to old videos from past ATM events:


What can I say. Visual Studio, TFS, Azure, SharePoint , Windows 8, etc. Pure geeky fun time. See you there on May 8th, 2014! :)

TFS 2013 Upgrade - SharePoint 2010 to SharePoint 2013 Upgrade Errors

OK, so I'm upgrading TFS 2008 with SharePoint Foundation 2007 installation to TFS 2013 with SharePoint Foundation 2013. Naturally, you do an upgrade using an intermediary server with TFS 2012 with SharePoint 2010 install, because you cannot upgrade TFS 2008 to TFS 2013 directly (you have to upgrade to TFS 2012 first), just as you cannot upgrade SharePoint 2007 to SharePoint 2013 (you have to upgrade to SharePoint 2010 first). All goes well except for the SharePoint portion of the upgrade.

Running Test-SPContentDatabase against SharePoint content database produces a few weird errors, like:

Category : MissingFeature Error : True UpgradeBlocking : False Message : Database [WSS_Content] has reference(s) to a missing feature: Id = [00bfea71-c796-4402-9f2f-0eb9a6e71b18], Name = [Wiki Page Library], Description = [An interconnected set of easily editable web pages, which can contain text, images and web parts.], Install Location = [WebPageLibrary]. Remedy : The feature with Id 00bfea71-c796-4402-9f2f-0eb9a6e71b18 is referenced in the database [WSS_Content], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary

You would think that Wiki Page Library feature should exist in new SharePoint, and it does, but the error still shows up. Makes no sense, right. Well, if you try to go ahead and proceed with an upgrade anyways, you will see even stranger things. Upgrade completes successfully, but none of the SharePoint pages come up properly. None of the "default" SharePoint web parts come up properly. To make things worse, you cannot get to any of the system pages in SharePoint. When you try to access any system pages, like Site Settings, you get Access Denied errors (strange part is that you are denied access to built-in v4.master master page; how is that possible!). Very strange…

After a bit of digging on the web, I have found a solution. Apparently, the problem was caused by the fact that SharePoint 2013 has two modes (hives), 2010 (v14) and 2013 (v15). Apparently, by default, a new SharePoint 2013 installation mostly only installs v15 features. Using SharePoint Feature Admin Tool, we can tell that v14 features we needed were not installed. Now that we know that we can simply install missing v14 features individually using SharePoint 2013 Management Shell or we can simply install all existing features in both the v14 or v15 hives by running the following cmdlet.

Install-SPFeature -AllExistingFeatures

Second approach was easier, so I run with it. Running that cmdlet fixed all of my SharePoint problems, and that's a good thing.

How to connect Release Management to Team Foundation Server

Release Management for Visual Studio 2013 (formerly known as inRelease client) is tightly integrated with Team Foundation Server (TFS 2010, TFS 2012 and TFS 2013 versions are supported. Visual Studio Online is not supported yet) To connect  Release Management server to Team Foundation Server, you need to use Release Management Client for Visual Studio 2013:

  • Launch Release Management Client for Visual Studio 2013. If you launch it for the first time, you will be prompted with Configure Services dialog window. Just enter Release Management server name and port number, and click on OK.
  • Click Administration tab to connect Release Management server to TFS. Then, click on Manage TFS section.
  • Click New button to add a TFS connection. You can add connections to many project collections hosted on different TFS servers or many separate project collections hosted on the same TFS server.
  • Provide the following connection settings:
    • name or the URL of TFS server
    • name of the project collection
    • service account credentials to connect to TFS
    • HTTP/HTTPs protocol used to connect to TFS
  • Click Verify to validate the settings provided.
  • Click Save and Close to save the connection to TFS

That's all. Now you should be able to start using Release Management server with TFS. Oh, almost forgot, to configure connection to TFS, your account(s) must have the following minimal permissions

  • Collection Level 
    • 'Make requests on behalf of others' permission (required to setup TFS Connection in release management server)
    • 'View collection-level information' permission (to get list of Build Definitions on behalf of current user) 
    • 'View build resources' permission (to set a Build to Release) 
  • Team Project Level – for all projects used in release management 
    • 'View project-level information' permission (to add a TFS Group) 
  • Build Definition Level – for all build definitions used in release management server
    • 'Retain Indefinitely' permission (when starting a Release)

To keep things simple, you can simply make service account used by release management server to connect to TFS a member of the Project Collection Service Accounts group. 

Release Management Build Template

If you’re working with the Release Management Server (and you should, because it's awesome) and cannot find the location of the Release Management Build Process Template, then try looking under 

C:\Program Files (x86)\ Microsoft Visual Studio 12.0\ReleaseManagement\bin.

In some cases you might only see ReleaseDefaultTemplate.11.1.xaml (TFS 2012 build template) or ReleaseDefaultTemplate.xaml (TFS 2010 build template) under C:\Program Files (x86)\ Microsoft Visual Studio 12.0\ReleaseManagement\bin. But where is TFS 2013 build template you might ask. Without one you cannot properly integrate Release Management with TFS 2013, which would be fairly disappointing. Luckily, you can download TFS 2013 template here. Inside this .zip file you will find three files:

  • TfvcTemplate.12.xaml (for when you're using TfvcTemplate.12.xaml)
  • GitTemplate.12.xaml (for when you're using GitTemplate.12.xaml)
  • ReleaseTemplate.12.Snippets.xaml (for when you would like to add release management functionality to your custom TFS 2013 build template. snippets file only contains sections with start / end markers to indicate which parts to copy)

Please note that, Release Management Build Process Template are not installed in TFS by default, so it won’t appear as an available build process template until you add it. To add the release management build process template, you will need to check it in to your TFS source control, and then add the build process file when editing (or adding) a Build Definition. Once the release management template has been added to the list of build templates, you can start using it. More on how to use release management build template later... 

Using Deployment Metadata in TFS Release Management

TFS Release Management allows you to use deployment metadata as a value for configuration variables in release templates. It comes in very handy when you need to refer to the build drop location or build number. The following is the list of available Metadata that can be used with Configuration Variables.

Build Directory        $(PackageLocation)

Build Number        $(BuildNumber)

Build Definition    $(BuildDefinition)

TFS Collection        $(TfsUrlWithCollection)

Team Project        $(TeamProject)


Unfortunately, you cannot create custom deployment metadata just yet. Hopefully that will change one day. Another "catch" is that deployment metadata can only be used in components. Deployment metadata cannot be used in actions or tools because those are taking place outside of the build process.