Saturday, 15 December 2012

Review – Professional Visual Studio 2012

This heavy, 1054 pages book is the reference for every developer approaching Visual Studio 2012.


If the review would be just one sentence long, this would be my review Smile but it isn’t, so here’s the thoughts: the book is huge, wrote by Bruce Johnson (Visual C# MVP) and provides an analytic insight inside the new Microsoft IDE.

As it is focused on the IDE itself, it doesn’t do deep dives on ASP.NET MVC or WPF, just to say, but it provides some technology samples to quickly start up beginners. Every tech sample is in both VB and C#.

You might think it’s just for beginners: that’s wrong. It’s a deep dive on the IDE feature set, and it’s not targeted at providing code apart from the related one. It’s useful as well for experienced developers.

A notable example: the Visual Studio Extensibility chapter is really complete and provides several samples regarding the model, guiding step-by-step the reader from the bottom-up.

Completing the field, the book provides some separate chapters for Visual Studio Ultimate and its exclusive features, and Team Foundation Server, making them fit inside the Microsoft’s ALM family of products.

I really liked it, and I strongly suggest it to all the developers working with Visual Studio 2012.

Tuesday, 11 December 2012

Workspace Templates: a useful helper for non-VS users

If you have a user which doesn’t use Visual Studio (reasons may vary: designers, stakeholders, analysts, etc.) but uses the Windows Explorer Integration brought you by the Team Foundation Server Power Tools, this user must go through the Team Explorer at least for setting the workspace.

Letting them use the Team Explorer is a shocking experience, from a users’ point of view: they are not used to the complexity of Visual Studio, and this can lead to errors and problems.

In order to fix that, we can use the tf workspace command-line tool, with the /template switch.

It’s extremely easy:

tf workspace /new /template:myworkspace;TFSAdmin /collection:http://server:8080/tfs/Collection

It takes a myworkspace linked to the user (in my case, TFSAdmin) and it creates for the current user a copy of it. So the project is already mapped, and the user can start using the Windows Explorer Integration alone.

Monday, 3 December 2012

Batched Gated Check-ins

A subtle new feature in Team Build 2012 is the possibility of batching the gated check-ins workflow, which enables you to “sum up” your check-ins and let the Team Build elaborate them together.

It’s available under the Gated Check-in trigger in the Build Definition configuration:


Then, what happens if one of the queued builds fail? No problem, they are going to be sequentially reinitialized and individually elaborated, in order to avoid further problems.

It’s a feature which finds its fit just inside big teams, I admit it…but it can still be useful even in other scenarios.

Friday, 23 November 2012

Review - Visual Studio Team Foundation Server 2012: Adopting Agile Software Practices: From Backlog to Continuous Feedback


This book, wrote by Sam Guckenheimer (Product Owner for the Visual Studio ALM family) and Neno Loje (Microsoft MVP for Visual Studio ALM) is a complete, five star journey into the world of Agile Software Development.

After introducing the Agile Consensus and what rounds around it, the book covers all the basis for the Product Ownership, and details how every sprint should be managed. The first section is not just for beginners: there are concepts which even after a years-long seniorship, could be hard to fully understand. Do not underestimate how these concepts might be similar but different: after these the destiny of your project can be strictly dependent.

Then we have a chapter for everyone of the four classic pillars of Software Development, using Team Foundation Server: Architecture, Development, Build and Lab, Test. But do not expect anything ‘classic’ here: the content is extremely fit to the topic of the book, and it’s really comprehensive.

The last two chapters are not product or methodology focused: one is about the lesson learned at Microsoft – inside the Developer Division – and believe me, every word is worth of notice because it clearly explains what happens in a huge division like DevDiv, and what are issues and stop factors you might find in a real world scenario like that.

The other is on how to integrate the Continuous Feedback inside the usual workflow of the team, not technology focused but more on the theoretical side of the problem.

The target is pretty clear - Product Owners, Scrum Masters – but, again, not just for beginners: concepts explained here are not just Visual Studio ALM tied or step-by-step tutorials, they are just declined on the product, but agnostic on their side.

The book has lots in common with the previous release, it’s normal as it’s on methodologies and practices, but it has been broadly update for Visual Studio 2012 – so don’t expect a mere copy&paste. In the end, it’s a great resource for people working with planning, prioritizations and code quality.

Friday, 16 November 2012

Candidate Changes with Local Workspaces

As with the Local Workspaces we can work offline in a easier way than before, there’s another really useful side-effect of this: the so-called Candidate Changes.

When we add a file or delete something outside Visual Studio (in Windows Explorer for instance), regardless of the connection to the Team Foundation Server, it recognizes there’s something different:


Those changes are not included by default, as it was not an action done with Visual Studio, so another confirmation is required – I tried deleting the Program.cs file:


If I rename a file, it’s like every file renaming in Visual Studio: a delete followed by a add operation. If I select both, it can understand it and treat these two operations as a rename – in my case I renamed the App.config file to Appfile.config:


It’s a really powerful feature, both with and without connection to the Team Foundation Server, which allows us to keep tidy our operations outside Visual Studio (but not including those made with the Windows Explorer Shell Extension of the PowerTools).

Friday, 9 November 2012

Visual SourceSafe Upgrade to Team Foundation Server, the new way

Some minutes ago the Visual SourceSafe tool for migration to Team Foundation Server and Team Foundation Service. It is already available inside your Team Foundation Administration Console or from the Visual Studio Gallery. Beware, it requires a reboot of the server.

The installation is pretty straightforward: next next finish Smile


After you launch it, it’s going to ask you for what repository you are going to use, and which projects you’d like to migrate. You have to manually use Analyze, before of doing so. And you may select just some projects, if needed:


After this you have to select the destination for the Team Project…


…and the SQL Server to use as a storage, together with the migration type, full or tip:


At the end of the migration the tool is going to provide you a report like the one you were used with vssconverter.

Inside the MSDN library you can find the documentation about it, which is pretty comprehensive and includes how to use the command-line VSSUpgrade – the underlying command line tool you can use when you need to automate the migration or in some borderline cases (like when you have a huge database and you want to prevent errors caused by network connectivity disruption) – and the most common troubleshooting operations.

Friday, 2 November 2012

Review - Professional Application Lifecycle Management with Visual Studio 2012


If you have to start approaching the Application Lifecycle Management, this is going to be your bible.

Written by Mickey Gousset (Visual Studio ALM MVP), Brian Keller (Microsoft Senior Developer Evangelist ), Martin Woodward (Microsoft Program Manager for Team Foundation Server) the book starts with a six-chapters-long introduction to Team Foundation Server, describing in detail what’s this mystical object and how it can be useful for us Smile That’s different from the 2010 version, but I really like it because it enables the reader to fully understand the platform, instead on focusing on a series of tools and practices. It’s detailed but introductive, perfect for the target audience.

After that, it describes how to gather feedbacks from stakeholders, and how to let them participate in the requirements management phase.

The Project Management section is comprehensive, rounding from Work Items to Dashboards, describing all the tools involved in a complete ALM process. It’s not just about the tools and how to use them, several pages are dedicated to process and methodologies, making it a manual in the manual for Project Management with Team Foundation Server.

After these first three parts, the following are more code-focused: Architecture, Software Development and Testing. They fully cover the new features but always with the process companion. Really useful for both novice and experienced people who might want to have a reference.

Despite it has the same title of the 2010 version, several parts have been redone both after feedbacks and to have a different approach. I really liked this book, it’s a must-have for everyone.

Thursday, 1 November 2012

Upgrading Team Foundation 2012 Express

It can happen that you have to migrate from a TFS Express installation (reasons can be various) to a full featured one.

It’s pretty easy: as the Team Foundation Server database is the same regardless of the edition installed, it’s just a matter of upgrading the Application Tier in order to enable all the missing features.

The first thing to do is to uninstall Team Foundation Server Express if you’re doing an in-place upgrade, otherwise the installer is going to notify it to you:


Then, after the Team Foundation Server installation (again, in case of an in-place upgrade, otherwise after attaching the databases), the only required step is the Application-Tier Only procedure inside the Wizard.

After the Welcome screen, we just have to select the database instance and list the resident databases:


So we have to select the Service Account, in order to run the services:


Then we review the configuration…


…and scan for the readiness:


After clicking Configure, the Application Tier is going to be added and your database are going to be fully functional.


Wednesday, 31 October 2012

Team Foundation Service is RTM!

Today at //Build Microsoft unveiled what a lot of people was waiting for: the RTM of Team Foundation Service.

You can reach it at, despite the old will still work for some time. Billing is still not active, but now we know somewhat more over it

Here’s what you were waiting for: as promised, there’s still a free level of service.

It’s going to be free for team up to five users, with no feature limits!

And moreover, who has a MSDN Premium, Test Professional or Ultimate is entitled to have an unlimited subscription included inside his MSDN!

There’s going to be a paid service with unlimited users for who has not a MSDN Subscription but it’s still early to talk about that.

The only Team Foundation Service component still in beta is the Hosted Team Build.

Monday, 22 October 2012

Marking transactions on Team Foundation Server’s databases

As we know, in the Team Foundation Server PowerTools for the 2010 version and built-in in the 2012 version we have a Backup&Restore utility which is added to the Administration console for…backup purposes J

But it’s not always feasible: in some organization this kind of tooling could not be allowed, and therefore we have to follow the old manual procedure documented in MSDN.

It’s a little bit tedious, as it’s fully manual and we have to repeat this for each database in our Team Foundation Server deployment, so it can be error-prone, and during troubleshooting sessions it can lead to issues.

So, in order to minimize this, there’s a useful step to follow to track down all the transactions on the TFS’ databases: the transaction table.

It’s fairly easy: we have to create an empty table in each database, using the following script:

   1:  Use TFS_Configuration 
   2:  Create Table Tbl_TransactionLogMark 
   3:  ( 
   4:   logmark int 
   5:  ) 
   6:  GO 
   7:  Insert into Tbl_TransactionLogMark (logmark) Values (1) 
   8:  GO 

After that, we can create a Stored Procedure which marks every transaction on the TFS’ databases, and reports back to the table:

   1:  Create PROCEDURE sp_SetTransactionLogMark 
   2:  @name nvarchar (128) 
   3:  AS 
   5:  UPDATE TFS_Configuration.dbo.Tbl_TransactionLogMark SET logmark = 1 
   7:  GO 

Then you can run the Stored Procedure, and mark the transactions with a mark. As MSDN states, “TFSMark”.

   1:  EXEC sp_SetTransactionLogMarkAll 'TFSMark'
   2:  GO

So you can automate this Stored Procedure, and use it as a ‘filtered log’ on your database activities.

It’s nothing new in the end, but as it’s hidden inside the MSDN documentation I’ve never seen it out there, and IMHO it was worth of a mention.

Wednesday, 10 October 2012

Rollback Changeset in Team Foundation Server: the time machine

It may happen you have the need of rolling back a previous changeset (due to various reasons). As far as today, you could do it with Get Latest Version – compare – Merge&Fix. Fairly rough, and not intuitive.

To be honest, this feature existed since Team Foundation Server 2010. It was just tf rollback, and no GUI was provided.

Then the PowerTools integrated it with Visual Studio, but now it has been promoted as a first class feature in Visual Studio 2012.

The time machine (as I called it) works as following:


Then you get it inside the Pending Changes, and you only have to check it in the Team Foundation Server. It’s possible to rollback even selected changesets, ranges, etc.

Wednesday, 3 October 2012

Random questions I got on Team Foundation Service

During the last months I went back and forth demoing Team Foundation Service, and several questions came up. Despite there’s a FAQ page out there, it seems people don’t read corporate pages Smile, so I decided of putting them all together in this page.

Am I tied to Windows Live for my users? Can I use Office365 or corporate accounts?
The answer is not yet. The Team Foundation Service authentication relies on Windows Azure ACS, so it’s technically possible to federate users or use corporate accounts but at this time (October 2012) it is not an enabled scenario, and you still have to rely on Windows Live for authentication. Nothing prevents you to make your corporate accounts Windows Live IDs, just signing up with the Use an existing account option.

Are upgrades managed by Microsoft? Which version of Team Foundation Server do I get signing up on
The Microsoft’s approach on this is pretty clear. The hosted version is going to be always the most recent version on the market, as Brian Harry pointed out on his blog. The Team Foundation Service team works on a three weeks-long sprint, and delivers straight to the service, so you won’t have to wait for Service Packs or Cumulative Updates. Moreover, tfspreview is not subjected to the Patch Tuesday, as critical patches are applied daily if needed.

What about my data? I don’t trust Microsoft to be the hoster of my source code!
Despite you won’t be attracted by Microsoft’s policies and behavior, they are never going to read your data. It’s clearly written in the EULA you accept when you sign up for the service, they can just move your data for backup and high availability purposes, but they are not able to see what’s inside their databases. It’s a legal agreement, and because of this it’s not meant to be interpreted. It’s as it, period.

What about my data? I want to be able to move away from Team Foundation Service whenever I want!
Again, your data is your data. But remember tfspreview is…a preview Smile and so not feature-complete at the moment. Maybe the top priority now for Microsoft is to enable you to easily export your data. Meanwhile, you can always sync it to your on-premise instance of Team Foundation Service via the Integration Platform.

How expensive is the service going to be? How much is it going to cost?
In the Pricing page of it’s clearly stated that there’s going to be a free level of service. We still don’t know what does that mean (in terms of features), but it’s a fact.

These are just the five most common questions I got during these months. For a more complete set of answers, I suggest to go to Smile you’re going to find all you need there.

Friday, 21 September 2012

Team Alerts as an automated notification tool

Communication among team members is the main pillar for the modern ALM, no excuses.

There are many ways of getting all the team members involved, but sometimes a communication needs to be asynchronous and, more importantly, automated.

Here’s our help: the Team Alerts.

Alerts are customizable on a user basis, but with the new Team concept of Visual Studio ALM, we get Team Alerts. This alerts can be sent when a specific event happen, to a list of users.

In my case, I created a “Test Build Team”, which contains just one user (me J) and it is obviously nested inside the main project team. In a real world scenario, this is supposed to contain all the users whose job is to manage the build.


After that, I can configure a new Team Alert, just for the Test Build Team (when a build fails, it’s triggered)


Then notice some details: thesubscriber is the whole team:


The alert is generated upon a query:


And the alert is sent to the email address of the whole team (so it can be a DL, for instance):


Wednesday, 12 September 2012

Understanding user loads with the Team Members tab

With the new wave of Visual Studio tooling for Project Management, I’ve been asked for a quick way of understanding commitment of the developers as a high level overview.

There are lots of ways doing so, but IMHO the quickest is the following: the Team Members tab in the Board.

Look at that:


In order to get a full picture I had to zoom it out. It’s pretty messy, and it’s good it is, but it’s not that useful…


So clicking on the team members tab, gives us a pretty comprehensive table:


This is definitely more readable than understanding a full taskboard on the run.

Sunday, 2 September 2012

Remote UAC with Standard Environment and Workgroup Machines

As using workgroup machines in Standard Environment is a borderline scenario, there are some issues and stuff to care about, like the careful usage of shadow accounts or the right management of Remote UAC.

In certain scenarios, having Remote UAC enabled may lead to wrong or misleading behaviors, as basically it doesn’t leases a admin token but (correctly, from a security perspective) just a limited one.

For example, the automated installation of the test agent inside a workgroup machine from another workgroup machine running MTM would fail, as this is a scenario where authentication and authorization (two different concept as we know). To workaround this and other cases, the solution is pretty simple. The only need is to set the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\LocalAccountTokenFilterPolicy key to 1.

This procedure is totally supported, as it’s stated inside this MSDN page on Test Controller configuration.

Monday, 20 August 2012

Beware of the Microsoft Account!

The introduction of the Microsoft Account as an identification method on Windows 8 is great, it enables several scenarios in a seamless way and it makes life easy for users.

But there’s a downside over there: some services won’t work as the required impersonation (there’s always going to be a “shadow user” of your Microsoft Accounton your pc) is not allowed to be done from a security perspective.

This leads to problems in particular with Visual Studio Team Lab Management, where a massive usage of the impersonation is done in order to use the Lab features.

In my case, I verified tons of troubles when, with a Standard Environment made of workgroup machines. In this case, the installation of the required agents inside the machines always failed, with no particular reason (and without a real error!):


Obviously I don’t want to manually install anything, so the solution is to use another Windows Account (warning: a local Windows Account) as the Lab Service Account:


That’s it Smile

Friday, 17 August 2012

Tailor-made Visual Studio 2012 installations (aka unattended, the new way)

Up to Visual Studio 2010 the unattended installation was made up of many steps, making a journey into a .ini file…

With Visual Studio 2012, the new experience is pretty faster, cleaner and easier.

The first thing to do is to create a Network Image, to be used into the company to deploy Visual Studio 2012. You have to create a X:/IDEinstall folder.

Then the only needed step is to customize the AdminDeployment.xml file! I won’t go deep dive on the schema as the MSDN documentation is self-explanative, but it can be summarized as it: you can choose which component to install in a Yes|No binary choice.

Once the AdminDeployment.xml file is customized as you want, you just have to grant the share all the required permissions and the users are automatically going to install Visual Studio with the defined settings.

Otherwise a silent installation is possible using the following command line statement:

\\ServerName\IDEinstall\vs_Product.exe /adminfile AdminDeployment.xml /quiet /norestart

This statement is also the way of managing Visual Studio installations, both quiet and interactive. Again, everything relies on the AdminDeployment.xml file.

Friday, 3 August 2012

Visual SourceSafe to Team Foundation Server step by step

As I tweeted some weeks ago, the Visual SourceSafe 2005 support expired July 10th, 2012. So it is no more a supported solution from Microsoft.

If you have some Visual SourceSafe still lying around your datacentre, here’s how to kill them with no pain Smile

First of all: you’re going to need the VSSConverter, a fantastic tool contained in the Visual Studio installation, under

<drive>:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE

Beware: with Team Foundation Server 2012 there’s going to be a new tool to perform migrations. I’m going to post something on the new tool as soon as I can, but for now this is the only way to migrate it. Moreover, if you won’t have Team Foundation Server 2012, you have not that much possibilities…Smile

I strongly suggest you to copy the VSSConverter and its related files inside a folder, like <drive>:\Migration, in order to keep everything simple.

Then you have to create two XML files: one is for the Analysis, and the other for the Migration. I won’t go into details, everything you need about those files are into the MSDN but…I provide you two samples Smile here’s one for the Analysis, and here’s the other for the Migration.

To analyze the Visual SourceSafe database, use the following command (from an elevated command prompt):

vssconverter.exe analyze analysissettings.xml

It analyzes the Visual SourceSafe database (or part of it), and provides us a report, to understand whether there are errors, and a UserMap.xml file. Inside of it we can find the Visual SourceSafe users to map to the correct Active Directory user in Team Foundation Server.

What does it happen if I don’t map a user (for various reasons)? Well…despite it’s strongly suggested to do so, the difference in behavior is the following:

Changeset 4121 – Committed by DOMAIN\UserWhoDidIt – Comment

Changeset 4121 – Committed by DOMAIN\MigrationUser – Comment (Committed by UserWhoDidIt)

After finalizing the user mapping, we use the following command to migrate:

vssconverter.exe migrate migrationsettings.xml

And the migration takes place Smile that’s it!

Saturday, 21 July 2012

Team Build Nuggets: Automatic publishing of Web Applications with Team Build

As we’ve seen in the previous post, we can automate the creation of a deployment package to automate deployment of web applications.

What we’ve seen until now is just the beginning: in this post we’re going to cover the fully automated deployment workflow.

But before of that, we need a prerequisite: the Web Deployment Tool.

It’s downloadable from the Web PI Installer, and the only configuration needed is this (on the target server).

After that, do you remember the MSBuild Argument to pass inside the Build Definition? It was:


Instead right now we need a little more verbose one:

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=InProc /p:MSDeployServiceUrl=<server> /p:DeployIisAppPath="Default Web Site/<mypath>" /p:UserName=<domain>\user /p:Password=<password>

It creates a package which gets pushed to the server running the WDT, and automatically executed. Smile

Monday, 16 July 2012

Team Build Nuggets: XCopy Deployment

What’s needed to perform an XCopy Deployment with Team Build?

Just that as a MSBuild Argument:

/p:DeployOnBuild=true /p:DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempRootDir=\\<server>\folder

Thursday, 12 July 2012

Team Build Nuggets: Deployment Package

A great feature inside Team Build is the capability of creating deployment packages from the server in order to automatically deploy the application to the target server.

It’s really easy, you only have to create a Build Definition:


and adding the /p:DeployOnBuild=true switch to the MSBuild Arguments.


After building you’re going to find a <Project>_Package folder…


…which contains the package itself.


How to deploy it? Well…run the .deploy script or wait for another Team Build Nuggets postWinking smile

Friday, 6 July 2012

Baseless Merge 101

A Baseless Merge is a not-that-known feature of the TFS’ Version Control System.

It’s a merge made with two branches of a root with no relationship between them. For instance, two parallel ‘release’ branches.

The suggested way of performing a merge with two branches like those lying around is to reverse integrate the first one into the root and then to remerge inside the other child. But this approach is not always feasible, so you can perform a baseless merge.

It’s a rather risky operation: the Visual Studio ALM Rangers strongly recommend to avoid it, because of the inner troubles inside it: no propagation for deletions, and no auto-solving of conflicts.

Up to Visual Studio ALM 2010, the baseless merge was there! But it was not integrated inside the IDE, and then the only option was to use tf.exe (tf merge /baseless …).

Nowadays we have this feature inside Visual Studio 2012, so no more command line playing.

For instance, in this scenario I’d want to merge Feature1 and Feature2…


…I can do it by calling the Merge Wizard.


It’s explicitly warning me I’m doing something risky: the baseless merge has no relationship with its siblings.

Moreover, if you try to drag and drop from the Hierarchy Viewer, you won’t be able to do a baseless merge. As of its nature, it must be done just purposefully and not ‘by error’.

Monday, 11 June 2012

How to instrument an application with PreEmptive Analytics for Team Foundation Server

As I previously posted, in this release we have a powerful instrumentation tool for our exceptions: PreEmptive Analytics.

Given the required server side configuration, here’s what’s needed on the client side:

Open up Dotfuscator:


Set a new executable to target:



Then select Analytics…



…and we start adding attributes:


One of the few things we need is an Application ID:



Then we add the SetupAttribute to instrument our methods:



Here we need to configure the Endpoint: as a default setting, the address to set is tfsserver:8000/Message/Endpoint.ashx



The Teardown attribute is needed to clean up after the execution;


The only missing stuff is the configuration itself:pa15

We go creating a new subscription:


Copy-paste the IDs needed (Company and Application). The most important setting here is the Threshold: if we set it to 1, we’ll have an Incident work item for every time the exception raises.


That’s it people Smile